text stringlengths 256 65.5k |
|---|
Hello!
I used to draw a rectangle of a certain color and thickness in PDF Viewer using annotations (with the JavaScript function addAnnot()).
Could I simply draw a rectangle with any function of the PDF-Tools Library or should I also create an Annotation with the PXCp_Add3DAnnotationW() function? The problem is I'm try... |
Using a relay with the ESP32 or ESP8266 is a great way to control AC household appliances remotely. This tutorial explains how to control a relay module with the ESP32 or ESP8266 using MicroPython firmware.
We’ll take a look at how a relay module works, how to connect the relay to the ESP32 or ESP8266 boards and build ... |
使ç¨scikit-learn忏¸ææµå¤±ç¨æ·é¢æµ
å¨scikit-learnä¸ï¼æ´ç´ è´å¶æ¯æå¦ä¸ä¸ç§ç±»åï¼
髿¯æ´ç´ è´å¶æ¯
ä¸è¬ç¨äºè¿ç»åç¹å¾é¢æµæ¨¡å
å¤é¡¹å¼æ´ç´ è´å¶æ¯
ä¸è¬ç¨äºç¦»æ£åç¹å¾é¢æµæ¨¡å
伯åªå©æ´ç´ è´å¶æ¯
ä¸è¬ç¨äºäºé¡¹åå¸çç¹å¾é¢æµæ¨¡å
以䏿¯è¿ä¸... |
Hello Guys How are you all ? Hope you all are fine. I am trying to read macro enabled excel work sheet using pandas.read_excel with xlrd library. But I am facing xlrd.biffh.XLRDError: Excel xlsx file; not supported this error.
So here I am come with all possible solution .
What is Error
When you try to read macro enabl... |
I have sample response with friends list from facebook:
[{u'uid': 513351886, u'name': u'Mohammed Hossein', u'pic_small': u'http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs643.snc3/27383_513351886_4933_t.jpg'},
{u'uid': 516583220, u'name': u'Sim Salabim', u'pic_small': u'http://profile.ak.fbcdn.net/hprofile-ak-snc4/h... |
A Python Tutorial, the Basics
ð A very easy Python Tutorial! ð
#Tutorial Jam
@elipie's jam p i n g
p i n g
Here is a basic tutorial for Python, for beginners!
Table of Contents:
1. The developer of python
2. Comments/Hashtags
3. Print and input statements
f' strings
4. If, Elif, Else statements
5. Common Modules
... |
[1] Python Made EZ! ð
HîïÃīįì everyone!
Hope y'all are doing great! School is starting real soon, so I hope you have been studying to get ready you are enjoying the last of vacation!
So I made this tutorial on python so that others can try to learn from it and get better! Hopefully, what I say will be comprehe... |
真實的應用程式具有真實的資料和真實的巢狀資料。 物件列表內的物件,物件內的物件。
在進行巢狀資料走訪方式是否會遇到兩個問題
程式碼可讀性差
發生錯誤時很難 Debug
glom 是一種處理真實世界資料的強大新方法,其特點是:
基於路徑的訪問巢狀資料結構
可讀,有意義的錯誤消息
使用輕量級 Pythonic 規範進行宣告式資料轉換
內建的資料探索和除錯功能
範例
沒有使用 glom
>>> data = {'a': {'b': {'c': 'd'}}}
>>> data['a']['b']['c']
'd'
>>> data2 = {'a': {'b': None}}
>>> data2['a']['b']['c']
Tra... |
Is it intended behavior that hMailServer will not add the SpamAssassin score to its own score unless the SpamAssassin score is greater than or equal to the SpamAssassin spam threshold (i.e., SpamAssassin tags it as spam)? I've seen some discussions on this and it is eventually just dropped and the people usually just l... |
Python - 65535
http://ideone.com/knKRhn
from math import exp, log
def divnr(p, q):
"""
Integer division p/q using Newton-Raphson Division.
Assumes p > q > 0.
"""
sp = p.bit_length()-1
sq = q.bit_length()-1
sr = sp - sq + 1
s = []
t = sr
while t > 15:
s = [t] + s
t = (t>>1) + 1
# Base-c... |
I want to remove all empty strings from a list of strings in python.
My idea looks like this:
while '' in str_list:
str_list.remove('')
Is there any more pythonic way to do this?
I would use filter:
str_list = filter(None, str_list) # fastest
str_list = filter(bool, str_list) # fastest
str_list = filter(len, str_l... |
【百度云搜索,搜各种资料:http://www.bdyss.cn】
【搜网盘,搜各种资料:http://www.swpan.cn】
注意:数据保存的操作都是在pipelines.py文件里操作的
将数据保存为json文件
spider是一个信号检测
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from... |
I previously asked a question of how to enter this .txt file using pandas. I was trying with pandas.read_csv
What I found is that I can not read this file using read_csv unless I remove the header data (down to the "#").
The problem is, I need to extract data like, Well Name, Well KB, Well Type... from the header data.... |
I am currently trying to get a decent score (> 40% accuracy) with Keras on CIFAR 100. However, I'm experiencing a weird behaviour of a CNN model: It tends to predict some classes (2 - 5) much more often than others:
The pixel at position (i, j) contains the count how many elements of the validation set from class i wer... |
我遇到了一些麻烦,弄清楚如何处理在顶部或底部碰撞的碰撞。 如何指定这些碰撞?
这是一个小小的代码片段,让您了解我的方法。 现在它在哪里碰撞并不重要。
# the ball has hit one of the paddles. send it back in another direction. if paddleRect.colliderect(ballRect) or paddle2Rect.colliderect(ballRect): ballHitPaddle.play() if directionOfBall == 'upleft': directionOfBall = 'upright' elif directionOf... |
@Botenga delete this code you have at the end of your html:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="bootst... |
æ¬æä¸»è¦æ¯ç»åºäºå
³é®è¯çä¸ç§æ°çå®ä¹ï¼å¹¶ä¸åºäºWord2Vecç»åºäºä¸ä¸ªå®ç°æ¹æ¡ãè¿ç§å
³é®è¯çå®ä¹æ¯èªç¶çãåççï¼Word2Vecåªæ¯ä¸ä¸ªç®åççå®ç°æ¹æ¡ï¼å¯ä»¥åºäºåæ ·çå®ä¹ï¼æ¢ç¨å
¶ä»çæ¨¡åæ¥å®ç°ã
è¯´å°æåå ³é®è¯ï¼ä¸è¬ä¼æ³å°TF-IDFåTex... |
Handling Python Memory Issues when faced with Big Data
As the programming language Python develops over time, added functionality improves both its usability and performance. Python has become (if not) the foremost language in the Data Science and its handling of big data sets is amongst one of the reasons why.
It’s no... |
wiuppy
wiuppy is a Python3 wrapper for the Where's It Up API (version 4).
Requirements
Python 3.2
requests
Installation
Once you have cloned the repository, you can install the module with pip (orpip3 on Ubuntu:
$ git clone https://github.com/WonderNetwork/wiuppy.git
$ cd wiuppy
$ sudo pip3 install .
Usage
See the off... |
Artificial Intelligence has vast-ranging attention and its utilization in the healthcare business or industry. As an intense learner and a Kaggle beginner, I chose to work on the Malaria Cells dataset to get a little hands-on experience and discover how to work with CNN, Keras, and pictures on the Kaggle platform.
In m... |
I am having trouble with Pandas.read_csv
I would like to read this text file (see below) When I take this data and copy it into excel > text to columns > delimited by "Space" it gives me the exact output I am looking for.
I have tried a bunch of different ways, I thought that the regEx to account for multiple spaces wo... |
TensorFlow 1 version View source on GitHub
Represents a potentially large set of elements.
tf.data.Dataset( variant_tensor)
Used in the notebooks
Used in the guide Used in the tutorials
The tf.data.Dataset API supports writing descriptive and efficient inputpipelines. Dataset usage follows a common pattern:
Create a so... |
import matplotlib.pyplot as plt
x = range(101)
y = xl
ine, = plt.plot(x,y)
plt.ion()
for i in range(1,100):
y2=[y[i2]/i for i2 in range(len(y))]
line.set_ydata(y2)
plt.draw()
plt.pause(0.05)
Matplotlib縺ァ縲∝虚縺上�励Ο繝�繝医r縺励◆縲�
谺。縲�縺ォ縲√�励Ο繝�繝医@縺溘ョ繝シ繧ソ繧呈峩譁ー縺吶k縺溘a縺ォ縲�
line.set_ydata(y2)
plt.draw()
縺ィ縺励◆縲�
繝励Ο繝... |
UNSOLVED Metrics Machine freezing on Groups update
I am working on updating / building groups in Metrics Machine, and I have hit the same blocker 3 times so far today. Iâm wondering if anyone may have any suggestions on how I might avoid it in the future, and I partly hope it might be something that could be further... |
機械学習を用いて夜空に浮かぶ星座を判別したかった話
初めまして。aidemy研修生の笹川です。 これから空気が澄んで星の見やすい季節になりますね。 冬であれば、あれはオリオン座であれはふたご座... そのくらいは言える方が多いかも知れませんが、 もっと難しい星座も見つけられたら格好いいし、 星空を見るのが楽しくなると思いませんか? しかし、何の当てもなく星座を見分けることは容易ではありません。 そこで今回は星座の画像を学習し、機械の力で夜空の星座を判別することができないかやってみようと思います。
目次[非表示]
実行環境
macOS Mojave 10.14 Python 3.6.3 jupyter notebook
データ
星座の... |
Explicit Reporting - Jupyter Notebook
Trains is now ClearML
This documentation applies to the legacy Trains versions. For the latest documentation, see ClearML.
The Allegro_Trains_logging_example.ipynb example demonstrates integrating Trains explicit reporting running in a Jupyter Notebook. All Trains explicit reportin... |
OpenStack task_state in Python API
Hello guys!
I have a problem that I need to get task_state of a VM via Python but I don't know how. Here's the thing:
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "nova",
"OS-EXT-SRV-ATTR:host": "compute",
"OS-EXT-SRV-ATTR:hostname": "new-s... |
Recently, after a round of patching (11/13) all of the servers stopped authenticating ssh sessions using AD creds. However, if i login to a server with root, i can su to the AD account without issue.
I think a patch changed the server behavior but i cannot figure out where the issue is. here are some logs that might he... |
La clasificación de contenido analiza un documento y muestra una lista de categorías de contenido que se aplican al texto encontrado en el documento. Para clasificar el contenido en un documento, llama al método classifyText.
En esta sección, se muestra cómo clasificar el contenido de un documento.
Clasifica el conteni... |
FIrst time arch user here and I have trouble with setting my screen resolution for my primary screen. My second screen is a laptop screen with a working 1920x1080 resolution.
Problem:
I am trying to add a resolution of 1920x1080 for this primary screen as currently I am only offered 1600x1200 for this.
The resolution w... |
Seems to be more or less OK. I don’t get the “System GUID at…” here though when I print, just the name.
You can shorten your script considerably though (unless you want the intermediate results as well):
import rhinoscriptsyntax as rs
all_objs = rs.AllObjects()
layernames = set()
for obj in all_objs:
if rs.IsObject... |
I finally got around to working on my Amazon project again.
Misc Notes
# Change postgres data directory
File path:
/etc/postgresql/10/main/postgresql.conf
File System Headache
I decided to clean up my hard drives, but I forgot how much of a headache it was trying to get an NTFS drive to work with transmission-daemon. W... |
Let's learn Aardvark
Welcome to Aardvark, the language that has entranced programmers by its simplicity and amazingness for the last few days.
My goal is to by the end of this lesson have taught you the basics of the Aardvark language and get you on a course to become an amazing Aardvark developer.
In programming, you ... |
Let's learn Aardvark
Welcome to Aardvark, the language that has entranced programmers by its simplicity and amazingness for the last few days.
My goal is to by the end of this lesson have taught you the basics of the Aardvark language and get you on a course to become an amazing Aardvark developer.
In programming, you ... |
Dynamix
Dynamix (aka Introduction’ Intro of Dynamix on N64) is a N64 homebrew demo made by Immortal and Widget and published in December 1997. The demo is a marquee/bitmap style, with a floating 2D logo, some rotating 3D characters and scrolling text.
You can download the ROM for Dynamix as well as its associated files... |
3D Projection Tutorial
I am going to teach you how to draw a 3D object.
I'm going to start with some useful information about the project bellow. First, it takes about 10 - 15 seconds to generate the map. Second, use WASD to move left, right, forward, and down and use space and right shift(not left shift) to go up and ... |
blob: da20c004bf31544522e7d7e5b549d2d909daa93b (
plain
)
# Copyright (C) 2009, Tutorius.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your optio... |
I am interested in doing a 2D numerical integration. Right now I am using the scipy.integrate.dblquad but it is very slow. Please see the code below. My need is to evaluate this integral 100s of times with completely different parameters. Hence I want to make the processing as fast and efficient as possible. The code i... |
Closed (moved)
Open
tor_bug_occurred_: Bug: src/or/entrynodes.c:1845: select_entry_guard_for_circuit: Non-fatal assertion !(!guard_has_descriptor(guard)) failed.
using public obfs4 bridges.
Feb 08 12:13:40.000 [warn] tor_bug_occurred_: Bug: src/or/entrynodes.c:1845: select_entry_guard_for_circuit: Non-fatal assertion !... |
Scatter plots are useful to show data points that lie in 2D. Drawing a scatter plot in Matplotlib is easy using the scatter function.
(N, 1), drawing a scatter plot is straightforward:
import matplotlib.pyplot as mplot
# x_vals is NumPy array of shape (N, 1)
# y_vals is NumPy array of shape (N, 1)
mplot.scatter(x_vals,... |
The wsrf is a parallel implementation of the Weighted Subspace Random Forest algorithm (wsrf) of Xu et al. A novel variable weighting method is used for variable subspace selection in place of the traditional approach of random variable sampling. This new approach is particularly useful in building models for high dime... |
webサイトのトップページなどに多くみられる、画像やコンテンツを左右に切り替える、スライダー slider(カルーセル carouselとも)。
jQueryプラグインとしてさまざまなスライダーが公開・提供されていますが、中でも設定の簡単さとオプションの充実度からお勧めしたいのが今回解説する『slick』です。
今回はその設置手順とサンプルを交えた使い方と各種オプションの詳細をデモを交えて解説していこうと思います。
索引
『slick』の主な機能と特徴
まずはslickの主な機能と特徴をピックアップ。
レスポンシブ対応
ブレイクポイントごとの設定振り分けが可能
タッチデバイスに対応
IE8以上のブラウザで完全動作
縦・横カーセルに対... |
Get SMS delivery status with Python
Get SMS delivery status with Python
Create group with Python
Get group field list with Python
Add a field to a group with Python
Delete a field from a group with Python
Delete a contact from a group
Assing country to e group with Python
Get group contact list with Python
Add contact ... |
HLSを使ったライブストリーミングを試してみます
あらすじ
前々回はPythonからWin32APIをバシバシ叩いてきりたん好きなコトを喋らせることができるようになったのでした。
前回はAzureのWindowsServerにHTTPリクエストを送ってきりたん好きなコトを喋らせるサーバができたのでした。
今回は、HTTP Live Streaming(HLS)を用いてきりたんボイスをライブ配信してみようと思います!
HTTP Live Streaming
HTTP Live Streamingとは、Appleが開発したHTTPベースのストリーミング配信プロトコルです。 静的な動画ファイルのストリーミング配信はもちろん、ライブ配信(生... |
In part 2 of our series on MLflow blogs, we demonstrated how to use MLflow to track experiment results for a Keras network model using binary classification. We classified reviews from an IMDB dataset as positive or negative. And we created one baseline model and two experiments. For each model, we tracked its respecti... |
When I try to open FC, it shows the loading screen and then crashes.
If I run it through the terminal I get the following:
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f3060b73f20]
#1 /lib/x86_64-linux-gnu/libc.so.6(+0x18ad6a) [0x7f3060cbfd6a]
... |
blob: 1f27c5192b237f365404c2ff73227cbfd18545d9 (
plain
)
import locale
locale.setlocale(locale.LC_NUMERIC, 'C')
import signal , time , sys , os, shutil
import pygtk
pygtk.require( '2.0' )
import gtk
import gobject
import time
import common.Config as Config
from common.Util.CSoundClient import new_csound_client
from ... |
blob: 208b7f72bf8b5cadfe032ee1dc3414f2f1942e8b (
plain
)
import os, sys, string
import subprocess
num_replica = 2
num_stripe = 4
#Cachesize calculator
cache_size = "`echo $[ $(grep 'MemTotal' /proc/meminfo | sed 's/[^0-9]//g') / 5120 ]`"
class CreateVolfile:
def __init__ (self, server_dict, server, transport,
... |
蜈医↓譁ュ縺」縺ヲ縺翫¥縲�
蛹サ逋よュ蝣ア縺」縺ス縺�縺薙→繧呈嶌縺�縺溘′縲∬�ェ蛻�縺ッ蛹サ逋ょセ謎コ玖��縺ァ繧ゅ↑繧薙〒繧ゅ↑縺�縲�
蝌倥r譖ク縺�縺溘▽繧ゅj縺ッ縺ェ縺�縲ゅ@縺九@縲�髢馴&縺」縺ヲ縺�縺ヲ繧ゅ�∬イャ莉サ縺ッ謖√※縺ェ縺�縲�
閼ウ繝峨ャ繧ー縺ォ陦後▲縺ヲ縺阪◆縲や�樽RI縺ョ逕サ蜒上ョ繝シ繧ソ繧偵b繧峨▲縺溘�ゑシ�DICOM繝輔ぃ繧、繝ォ�シ俄�呈ョ句ソオ縺ェ縺後i縲〔-space縺ッ蜈・縺」縺ヲ縺ェ縺九▲縺溘��
縺励g縺�縺後↑縺�縺ョ縺ァ縲∫判蜒上ョ繝シ繧ソ繧剃コ梧ャ。蜈�繝輔�シ繝ェ繧ィ螟画鋤縺励※縺ソ縺溘��
MRI縺ィ縺ッ
MRI�シ�Magnetic Resonance Imagi... |
Macros
Macro creation
A macro is a function called from the BUILD file that can instantiate rules. Macros don’t give additional power, they are just used for encapsulation and code reuse. By the end of the loading phase, macros don’t exist anymore, and Bazel sees only the set of rules they created.
Native rules (i.e. r... |
So you got lots of documents and need fast querying, huh? Or you have tons of data and need to process and extract metrics. Either way, Elasticsearch (ES) can be a powerful engine to help you index, query and extract metrics from its document-driven storage. This post is very straightforward and intends to show how to ... |
M5StickVの問題がまったく解決しないので、とりあえず放置することにし、M5Stack Grayを手に入れた。ゆくゆくは回転式スイッチ(本体の向きによって操作するリモコンスイッチにする予定。
巷では、M5Stackの開発環境はM5UI.Flowに移行しつつあるようなので、version 1.3.2を入れてみたものの、GrayのGyroをどうやって読み取るのかがわからないので、当面はArduinoのFirmwareを入れて使うしかないかな、と思いきや、 http://www.openspc2.org/reibun/M5/UI-Flow/1.2.3/さんのところで、角度の検出方法も説明されていた。ありがとう!
手順
それぞれさらっと... |
데이터 안에 숨겨진 정보를 파악하여 의미있는 스토리를 제공하기 위해서는 올바른 데이터의 수집이 필수적이다.특정한 분석을 위해 스스로 데이터를 수집할 수도 있지만 이에는 한계가 있고,
빅데이터를 수집하는 기술로는 SNS, 뉴스 등의 웹정보를 인터넷에서 수집하는 크롤링(crawling), 각종 센서를 이용해 수집하는 센싱(sensing), 분산 시스템에서 데이터베이스 관리 시스템인 카산드라(Cassandra),
실습 csv파일을 불러온다.
hr <- read.csv("C:/data/hrdata.csv",header=T, stringsAsFactors = T)
names(... |
Kerasä¼´æèµ°æ¥ #
åæ³èµ·è¿å ¥æºå¨å¦ä¹ é¢åçè¿ä¸¤ä¸å¹´æ¥ï¼Kerasæ¯ä¸ç´éªä¼´å¨ç¬è ç身边ãè¦ä¸æ¯å½ååæè¿è¿ä¸ªåæ¶ç¢°å°äºKerasè¿ä¸ªè¿ä¹æç¨çæ¡æ¶ï¼è½å¿«éå®ç°æçæ³æ³ï¼æä¹ä¸ç¡®å®ææ¯å¦è½ææ¯ ååæä¸æ¥ï¼æ¯ç«å½åæ¯theanoãpylearnãcaffeãto... |
Bounty: 200
Bounty: 200
Are there any tricks I can employ to get IDEs to offer code completion for dynamically generated class attributes? For instance
class A:
def __init__(self):
setattr(self, "a", 5)
This code will set the class attribute of A called a to the value of 5. But IDEs do not know about a and... |
演示Django版本为当前最新版本v2.2
当Django配置文件中的INSTALL_APPS包含了django.contrib.auth时,就默认启用了一个简单的权限系统,提供了为用户或组分配权限的方法
之所以说简单呢?主要是因为:
1.默认的权限系统是基于表的控制,权限最小粒度是表
也就是说,假如有一个Blog表,我们可以赋予用户或组对Blog表有delete的权限,那么用户或组成员就可以删除全部Blog,是不能控制用户只能删除自己创建的blog的
2.每个Model模型默认只有四个权限,分别是添加add_、修改change_、删除delete_、查看view_,这些权限记录在Permission表中,表数据如下:
默认权限的创... |
models.py:
class Person(models.Model):
name = models.CharField(max_length=200)
CATEGORY_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
gender = models.CharField(max_length=200, choices=CATEGORY_CHOICES)
to_be_listed = models.BooleanField(default=True)
description = models.CharFiel... |
Making your own programming language with Python
Making your own programming language with Python
Why make your own language?
When you write your own programming language, you control the entire programmer experience.
This allows you to shape exact how each aspect of your language works and how a developer interacts wi... |
*********************
针对上边的power函数,如果大多数情况只需计算平方,就可以使用默认参数,对power函数做如下修改:
def power(x, y=2):
return x**y
此时调用power函数时,如果不提供y参数,则默认计算x的平方:
>>>power(3)
9
>>>power(3, 3)
27
注意默认参数需放在必选参数后边,通过默认参数,可以简化函数的调用。
Python中,定义一个函数要使用def语句,依次写出函数名、括号、括号中的参数(如果需要参数)和冒号:,然后在缩进块中(缩进四个空格)编写函数体,有返回值的话用return语句返回。将程序的大部分繁重工作移到函数中去完... |
Я программирую на Питоне шесть лет. За это время назрели некоторые мысли насчет языка и его роли в ай-ти. Я решил, что следующим погружением на несколько лет будет что-то функциональное. Зафиксирую соображения, пока не утратил контекст.
Ниже – попытка обозначить слабые и сильные стороны Питона. Постараюсь, чтоб не было... |
A Python Tutorial, the Basics
ð A very easy Python Tutorial! ð
#Tutorial Jam
@elipie's jam p i n g
p i n g
Here is a basic tutorial for Python, for beginners!
Table of Contents:
1. The developer of python
2. Comments/Hashtags
3. Print and input statements
f' strings
4. If, Elif, Else statements
5. Common Modules
... |
문ì ì¤ëª
JadenCaseë 모ë ë¨ì´ì 첫 문ìê° ë문ìì´ê³ , ê·¸ ì¸ì ìíë²³ì ì문ìì¸ ë¬¸ìì´ì
ëë¤. 문ìì´ sê° ì£¼ì´ì¡ì ë, s를 JadenCaseë¡ ë°ê¾¼ 문ìì´ì 리í´íë©´ ë©ëë¤.
ì íì¡°ê±´
së ê¸¸ì´ 1 ì´ìì¸ ë¬¸ìì´ì
ëë¤.
së ìí벳과 공백문ì(" ")ë¡... |
--- title: 折腾笔记:在GameShell上编译Godot游戏
折腾笔记:在GameShell上编译Godot游戏
2020/12/1
一切都源于某天深夜无聊逛淘宝说起。
偶然间看到了Retro Game、开源掌机,Hack之心燃起。
然而很多名为开源掌机,实际上只是拿来玩模拟器游戏。
外观设计也很土味😜
GameShell
可能是淘宝的推荐算法有所长进吧,偶然间发现一个叫GameShell的产品。
无论是外观、设计,还是类树莓派的架构(感觉就是魔改的树莓派)。
对于一个常年从事软件开发的人,给树莓派装个电池我都无从下手😭
这样的产品比开发板门槛低,可以带出门,像正常的手机那样充电。
基本上就是一个Portable的... |
在UI编程中,常常要对鼠标点击进行相应,首先如何获得鼠标点击呢?
缓存 I/O 又被称作标准 I/O,大多数文件系统的默认 I/O 操作都是缓存 I/O。在 Linux 的缓存 I/O 机制中,操作系统会将 I/O 的数据缓存在文件系统的页缓存( page cache )中,也就是说,数据会先被拷贝到操作系统内核的缓冲区中,然后才会从操作系统内核的缓冲区拷贝到应用程序的地址空间。用户空间没法直接访问内核空间的,内核态到用户态的数据拷贝
思考:为什么数据一定要先到内核区,直接到用户内存不是更直接吗?
缓存 I/O 的缺点:
数据在传输过程中需要在应用程序地址空间和内核进行多次数据拷贝操作,这些数据拷贝操作所带来的 CPU 以及内存开销... |
Ignore missing attributes for AST objects
$ python3.8
Python 3.8.5+ (default, Dec 12 2020, 16:21:57)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> cpython_ast = ast.Assign([ast.Name("test", ast.Store())], ast.Name("foo", ast.Load()))
>>> cpython_ast.type_comment
Traceb... |
Was hoping to get a bit of feedback on designing a rrule. I'm wondering what the best way to create a minutely rule is but omit entire days. So for example get 5 minute intervals every weekday between some time but omit certain holidays. I thought of using something like
INTERVAL = 5
BUCKETS = int(60 / INTERVAL * 24)
W... |
About Boolean Function
I want to find the Algebraic Normal Form of a boolean function.
For example:
sage: R.<x1,x2,x3> = BooleanPolynomialRing(3, order='degneglex')
sage: x3>x1
True
sage: L = BooleanFunction(x1+x2*x3)
sage: L.truth_table()
(False, True, False, True, False, True, True, False)
sage: L.algebraic_normal_fo... |
I have been trying to figure out how to generate a tar file of a directory of files. I have this code
tar = tarfile.open('/tmp/' + newDate + '.tar', 'w')
for fname in get_matching_s3_keys(bucket=agtBucket, prefix=key, suffix='.log'):
print(fname)
file_obj = s3object.Object(agtBucket, fname)
file_content = f... |
Is it intended behavior that hMailServer will not add the SpamAssassin score to its own score unless the SpamAssassin score is greater than or equal to the SpamAssassin spam threshold (i.e., SpamAssassin tags it as spam)? I've seen some discussions on this and it is eventually just dropped and the people usually just l... |
crypt.crypt() refuses non-ASCII passwords
On pypy-3.6-v7.3.2, the zope.password test suite fails as follows:
Failure in test CryptPasswordManager (zope.password.legacy)
Failed doctest test for zope.password.legacy.CryptPasswordManager
File "/home/cjwatson/src/python/zope.password/.tox/pypy3/site-packages/zope/passwor... |
Locale-specific attributes | Content bean content hierarchy
The content nodes have two locale-specific attributes, title and description. See the bean help for alternative, shorter names for these attributes. The title must be defined for each locale, though you can set it to the empty string. A new locale is defined b... |
How to make an unblocker
How to make an unblocker
I've seen a lot of unblockers out there, but none of them are mine so here's mine.
Concept
The basic concept of an unblocker is that we will utilize repl.it's virtual machine and their internet to provide not only an unblocker, but a vpn! (in california or smth)
Startin... |
Intro
All my spouse’s digital photo frames are either broken or nearly broken – probably she got them from garage sales. Regardless, they spend 99% of the the time black. Now, since I had bought that Raspberry Pi PiDisplay awhile back, and it is underutilized, and I know a thing or two about linux, I felt I could creat... |
So I ran my summarizer yesterday and it took literally all day to run only 200 products through the lex sum function. So I went through my code and added a timer for each major step in the process like so:
start = time.time()
asin_list = get_asins(limit)
end = time.time()
print('Get ASINs: ', end - start)
Turns out it... |
I have seen few py scripts which use this at the top of the script. In what cases one should use it?
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
As per the documentation: This allows you to switch from the default ASCII to other encodings such as UTF-8, which the Python runtime will use whenever it has to d... |
при проверке, что шина сообщений будет вызывать функции, обозначенные в одной из ее глобальных переменных
< Сильный > messagebus.py
from . import handlers
class MessageBus:
...
def handle_event(self, event: events.Event):
handlers_ = EVENT_HANDLERS.get(type(event))
...
EVENT_HANDLERS = {
eve... |
I’m trying to do a script to import a number of STLs, and for each one imported to name it as the filename.
browsed = rs.BrowseForFolder(title = "Auto-name Imported Files - Location Picker")
files = rs.OpenFileNames(title = "Auto-name Imported Files - File Picker", folder=browsed)
for filename_iteration in files:
r... |
Hello!
I used to draw a rectangle of a certain color and thickness in PDF Viewer using annotations (with the JavaScript function addAnnot()).
Could I simply draw a rectangle with any function of the PDF-Tools Library or should I also create an Annotation with the PXCp_Add3DAnnotationW() function? The problem is I'm try... |
I develop software for Python and Android.
Yes, you read that right. If you have been coding for a while and if Python is not the first programming language that you started with, then you definitely know what a Switch statement is, and appreciate how flawless it is, when you need to factor in multiple conditions/cases... |
OED tools: Pushover
The problem
In my last post about Linux at command I talked about notifications on my mobile.
In most of my automation scripts I prefer notifications to come to my mobile instead of via email or SMS (really? in 2015?) because:
it is always with me
I check it thousands times a day (I know you too ;-)... |
This blog post is part 5 of the Machinetalk explained series describing the concepts and ideas behind the Machinetalk middleware.
In this section, I describe the part of Machinetalk which probably needs most explanation. What I'm talking about is Machinetalk GSL - language bindings for Machinetalk using code generation... |
0xUsernames
Есть так много людей, использующих службу обмена сообщениями, что им не хватает места для хранения всех имен пользователей! Чтобы исправить это, они начнут хранить имена пользователей как шестнадцатеричные, где это возможно.
Если имя пользователя состоит только из символов 0123456789ABCDEF(без учета регистр... |
You are mixing function declarations and code execution. Do not.Your programme should look like:
def fun1():
# do_stuff
def fun2()
# do_stuff
def main():
fun1()
fun2()
if __name__ == "__main__":
main()
Stating the obvious in comments is not good
#adding every word into the wordlist
#wordlist2 = cle... |
概要
在 sklearn 包中,OneHotEncoder 函数非常实用,它可以实现将分类特征的每个元素转化为一个可以用来计算的值。本篇详细讲解该函数的用法,也可以参考官网 sklearn.preprocessing.OneHotEncoder。
解析
该函数在 sklearn.preprocessing 类中,格式为:
OneHotEncoder(n_values=’auto’, categorical_features=’all’, dtype=<class ‘numpy.float64’>, sparse=True, handle_unknown=’error’)
为了方便理解,我们先看下面一个例子:
# -*- c... |
To give credit where credit is due: This problem was taken from the ACMICPC-Northwest Regional Programming Contest. Thank you problem writers.
You are helping an archaeologist decipher some runes. He knows that this ancient society used a Base 10 system, and that they never start a number with a leading zero. He's figu... |
So, I have written a small python code which hangs on exec_command step when using support user and the same works fine while using root user
I have no problems running the script from the terminal when logged in as the support user. This is what I am unable to understand why does paramiko.exec_command hangs.
I have tr... |
å¨ç¬è«åï¼éè¦ç¥éè¿ä¸¤ä¸ªç¥è¯ç¹ï¼ï¼ï¼
å符串转åèç±»å
str --> bytes
encode()
åèç±»å转å符串
bytes --> str
decode()
1.以ä¸ä¸ªç®åçä¾å讲解urllib.requestæ¹æ³
read 读åç¸åºå
容ï¼å
容
geturl è·å请æ±çurl
getheaders è·å头é¨ä¿¡æ¯
getcode è·åç¶æç
rea... |
先日のの続きと言えば続きでありますし、そうではないと言えばそうではありません。当たり前です。
前回は Django の機能である Middleware を用いてリクエスト時にフックして認証を行うみたいなやり方を参照させていただきましたけど(例のあれ(仮題)- DjangoでBASIC認証とかHTTPSスキーム強制とか。)、似たような仕組みが WSGI にありまして mod_wsgi 経由で使えるってんでやってみました。あと、こちらを使うと Django の User で認証もできるっていうのもなかなかにありがたいのでこれも採用。
公式にきちんとドキュメント化されておりますので基本的には迷いようはないのですけど、今回導入先のサーバーさ... |
blob: 7a2bfd855ae1bdec27e65ea7dd543d9ea0892b3a (
plain
)
# -*- coding: utf-8 -*-
# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com)
#
# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Ge... |
Hàm sleep() trong Python
Hàm sleep() trong Python sử dụng để dừng thực thi luồng hiện tại trong số giây truyền vào.
Ví dụ 1: Sử dụng sleep()
import time
print ("In kết quả ra màn hình ngay lập tức.")
time.sleep(3)
print ("In kết quả ra màn hình sau 3s.")
Phương thức này không trả về bất cứ giá trị nào mà chỉ del... |
Lệnh if, if...else, if...elif...else trong Python
Trong phần trước chúng ta đã tìm hiểu qua về một số kiểu dữ liệu trong Python và cách dùng, cũng biết một chút về lệnh While trong Python. Ở phần này, bạn sẽ biết thêm về lệnh phổ biến nhất trong Python là if.
Nếu đã từng học ngôn ngữ lập trình khác hẳn bạn đã biết công... |
蝗櫁サ「陦悟�励′縺ェ縺懊≠縺ョ蠖「縺ェ縺ョ縺区ー励↓縺ェ縺」縺�
2テ�2縺ョ蝗櫁サ「陦悟�励�ッ
$$ツ・begin{bmatrix}ツ・cos{ツ・theta} & -ツ・sin{ツ・theta} ツ・ツ・ sin{ツ・theta} & ツ・cos{ツ・theta}ツ・end{bmatrix}$$
縺ェ縺懊%縺ョ蠖「繧偵@縺ヲ縺�繧九�ョ縺九�『ikipedia縺ァ縺ッ逵∫払縺輔l縺ヲ縺�縺溘�り�ス蜉帙′荳崎カウ縺励※縺�繧九�ョ縺九�∫怐逡・縺輔l縺ヲ縺�繧九�ョ縺ォ繧上°繧峨↑縺九▲縺溘��
蝗ウ蠖「逧�閠�蟇溘∪縺溘�ッ荳芽ァ帝未謨ー縺ョ蜉�豕募ョ夂炊繧医j縲』 ', y ' 縺ッ莉・荳九�ョ繧医≧縺ォ陦ィ縺輔l繧九%... |
The Case for Numba in Community Code
The numeric Python community should consider adopting Numba more widely within community code.
Numba is strong in performance and usability, but historically weak in ease of installation and community trust. This blogpost discusses these these strengths and weaknesses from the persp... |
I'm currently struggling with implementing the Multiplicative Kalman Filter or Error State Kalman Filter as described by Landis Markley in Attitude Error Representations for Kalman Filtering. Sadly there is two versions of almost the same paper online:
First of all, I'm a little bit confused why eq. 45 in 1 is differen... |
View on TensorFlow.org Run in Google Colab View source on GitHub
Overview
Using the TensorBoard Embedding Projector, you can graphically represent high dimensional embeddings. This can be helpful in visualizing, examining, and understanding your embedding layers.
In this tutorial, you will learn how visualize this type... |
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214... |
Dec 182018
Amazon's qid in the url is the number of seconds since January 1st, 1979. They use it to detect whether a link is freshly searched thus signaling that that keyword is searched, or if its an old qid then that keyword was not used and someone just visited the link (I probably explained that like crap, but I've... |
Making your own programming language with Python
Making your own programming language with Python
Why make your own language?
When you write your own programming language, you control the entire programmer experience.
This allows you to shape exact how each aspect of your language works and how a developer interacts wi... |
note:文字列の芸術は、SEフォントの奇妙さのためにここでひどく見えるかもしれません:P:(
矩形の角を表す4つのタプルのリストが与えられた場合、その順序で互いに半透明の四角形を描きます。
この課題では、左上隅に最小の座標を、X軸を右に、y軸を下に向かって大きくする必要があります。
(x0、y0、x1、y1)または(x0、x1、y0、y1)は、
>四角形の左上と右下隅の座標ペア(四角形の2つの形式のどちらかを選択できますが、一貫性が必要です)
「半透明の四角形」とはどういう意味ですか?さて、この挑戦のために、あなたはスペース文字と、ほとんどのボックス描画文字;具体的には、「太字」の文字を含む矩形を描画するために使用されたすべて... |
```(aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Use function that takes pandas series as argument i __init__ part
Mislav Å agovaclast edited by
Hello,
First, I want to say I read a plenty of docs (no all, there lot of stuff:)) and successfully implemented ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.