Skip to main content

Posts

Showing posts from 2019

Next day after a female programmer's dream

A female programmer's twitte on twitter: Last night I dreamed that my boyfriend and other women were shopping. My first reaction in the dream was to check the source code ... After debugging for a long time, I couldn't find out why the woman was not me, and I commented out the woman with tears , Another run is my boyfriend shopping by himself ... Reviews: Just point that woman's pointer at you, Who made you make your boyfriend public? Add a breakpoint to see who the woman is Really soft, you should shield his interface Protected shopping (youOnly) Design issues, should use the singleton pattern No regression test The standard practice is to make an assertion Commented out, do not need to change the shopping parameters? In the end, the woman was commented out with tears, and my boyfriend went shopping by himself after another run-> it is obviously a problem with the scope of the variable name, just change the name You c

5个最受欢迎的Android免费VPN应用程序 - 2019

作为外贸业务人员,我们每天要跟客户沟通,虽然可以打越洋电话,但是,国家电话有很多缺点,比如费用高,音质不好,出差在外时无法打电话,等等。我们就会想到用即时的消息软件跟客户沟通,比如wechat, whatsapp, line, 等等。Wechat在中国很是普及,在国外使用率却不高;而skype,WhatsApp在国外市场使用率却是出奇的高,而且,whatsapp不需要添加客户,只要你手机里有客户的手机号,而客户也恰好在用,你们就能聊天,视频等无限制的对话了。可是,国内的网络环境越来越收紧,很多国外应用都登录不上去,该怎么办呢?对了,就是使用vpn,就可以顺畅的使用这些服务和客户进行沟通了。 今天,我们介绍五个免费的android手机vpn 1. Turbo VPN Turbo VPN易于使用且性能稳定可靠,被认为是Android平台上最好的VPN服务。 作为一个免费应用程序,尽管它还具有内置广告,但实际体验不会对使用产生太大影响。 与免费VPN和免费VPN应用程序相比,Turbo VPN的连接速度相对优越。 当然,如果有太多人同时使用该应用程序,您仍然会偶尔遇到一些断开连接问题。 总而言之,此应用程序的最大功能是其简洁的界面。 打开Turbo VPN后,您可以一键激活VPN服务。 然后,您可以自由上网。 2. ExpressVPN ExpressVPN应用在Android手机和平板电脑上非常受欢迎。 它的免费版本为用户提供7天的无限VPN服务-足够用于海外商务旅行或短途欧洲旅行。  ExpressVPN的服务器分布在全球94个国家/地区,并且速度快且不间断。 为了保护用户隐私,他们的所有线路都将自动加密,并且其背后的公司拥有严格的“禁止登录”隐私保护政策。 同时,ExpressVPN还全天为用户提供在线支持。   3. Hotspot Shield应用程序已下载超过5000万次,并且此数据仍在增加。 免费版带有广告,但是您可以通过购买其高级版计划来消除广告的烦恼,还可以享受一些额外的功能。  Hotspot Shield的VPN服务线覆盖全球20个国家,并承诺确保用户拥有出色的体验和流畅的网络环境。   4.  TunnelBear VPN 这个可爱的TunnelBear提供两个软件包:免费和高级。 免费版每月包含500MB的数据流

A better sleep method than Thread.Sleep in C sharp

Sleep.CS: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using System.Windows.Forms; namespace TimerNoCpuConsume {     class Timer     {         public delegate void TimerCompleteDelegate();         [DllImport("kernel32.dll")]         static extern IntPtr CreateWaitableTimer(IntPtr lpTimerAttributes, bool bManualReset, string lpTimerName);         [DllImport("kernel32.dll")]         static extern bool SetWaitableTimer(IntPtr hTimer, [In] ref long ft, int lPeriod, TimerCompleteDelegate pfnCompletionRoutine, IntPtr pArgToCompletionRoutine, bool fResume);         [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Auto)]         [return: MarshalAs(UnmanagedType.Bool)]         static extern bool CloseHandle(IntPtr hObject);         [DllImport("User32.dll")]         static extern int Msg

Merge arrays by using numpy concatenate

In  [11]: dataArray = [] for df in DFList : volume = df [ 'Volume' ] close = df [ 'Close' ] high = df [ 'High' ] low = df [ 'Low' ] dateTime = df [ 'DateTime' ] logDel = np . log ( np . array ( high )) - np . log ( np . array ( low )) CloseMA = df [ 'Close' ]. rolling ( window = 5 ). mean ()[ 4 :] VolumeMA = df [ 'Volume' ]. rolling ( window = 5 ). mean ()[ 4 :] logRet_1 = np . array ( np . diff ( np . log ( close ))) logRet_5 = np . log ( np . array ( close [ 4 :])) - np . log ( np . array ( close [: - 4 ])) logRet_5_Ma = np . log ( np . array ( close [ 4 :])) - np . log ( np . array ( CloseMA )) LogVol_5 = np . log ( np . array ( volume [ 4 :])) - np . log ( np . array ( volume [: - 4 ])) LogVol_5_Ma = np . log ( np . array ( volume [ 4

get the moving average value with pandas

file['Date']=[d.date() for d in file['DateTime']]#add the date collumn DFList = [] for group in file.groupby(file['Date']):#split the dataframe according to the date      DFList.append(group[1]) len(DFList) testMA = DFList[0]['Close'].rolling(window=5).mean()[4:]#get the moving average by using the rolling method of pandas print(len(testMA)) print(len(DFList[0]['Close']))

C# client talking to python server with double converting to bytes

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net.Sockets; using System.Net; namespace Client {     class Program     {         static Socket ClientSocket;         static void Main(string[] args)         {             String IP = "127.0.0.1";             int port = 9999;             IPAddress ip = IPAddress.Parse(IP);  //将IP地址字符串转换成IPAddress实例             ClientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);//使用指定的地址簇协议、套接字类型和通信协议             IPEndPoint endPoint = new IPEndPoint(ip, port); // 用指定的ip和端口号初始化IPEndPoint实例             ClientSocket.Connect(endPoint);  //与远程主机建立连接             Console.WriteLine("开始发送消息");             byte[] message = Encoding.ASCII.GetBytes("Connect the Server");  //通信时实际发送的是字节数组,所以要将发送消息转换字节             double a = 0.0000008900056;             byte[]

python socket server

#!/usr/bin/env python # -*- coding: utf-8 -*- import socket import threading bind_ip = "127.0.0.1" bind_port = 9999 server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) server.bind((bind_ip,bind_port)) server.listen(50) print("[*]Listening on %s:%d"%(bind_ip,bind_port)) # 调用处理线程 def handle_client(client_socket):     request = client_socket.recv(1024)     print("[*]Received : %s"%request)     #送回一些服务器给客户端的悄悄话     client_socket.send("收到了,小乖乖!")     client_socket.close() while True:     client,addr = server.accept()     print("[*]收到连接,地址:%s:%d"%(addr[0],addr[1]))     client_handler = threading.Thread(target=handle_client,arg_str=(client,))     client_handler.start()

A man in Hunan China suspected of killing his wife and fleeing

On the afternoon of October 19, Modern women's newspaper learned from the relevant departments of Sangzhi County, Zhangjiajie, Hunan, China, that a major criminal case occurred in the county's Badongongshan Town at noon today. A woman surnamed Tian died 100 meters away from the her house door. After investigation by the local police department, Wang Yong, the husband of the victim, was suspected of committing the major crime. Wang Yong is now at large. The reporter learned that at 10:31 on the 19th, Tian also made a self-video of tik-tok in the Moments of WeChat . The text was: " Could you let go  of me? I want to get rid of all, I beg you to let go, don't torture me anymore, I am tired and hurt. " After more than an hour of the Moments of WeChat, Tian was found to be stabbed to death by a hundred meters near her home. What is weird is that, about two hours after Tian sent the Moments on Wechat, Tian's husband, Wang Yong, also sent a Mo