Monday, November 29, 2021

e-techbytes

e-techbytes


OSCHINA 社区最新专区文章

Posted: 29 Nov 2021 01:51 AM PST

OSCHINA 社区最新专区文章


为白描App的“匠人之心”加码,百度OCR让文字识别更智能

Posted: 30 Aug 2021 01:00 PM PDT

现实中,你可以轻松无障碍的阅读各类平面印刷文字以及身边的一切,或许你未曾想过,视障人群该怎么办呢? 统计数据显示,中国大约有1700万的视障群体,相当于每100个人中就有超过1位是视障人士。但我们在日常生活中却很少见到他们,那是因为视障群体在日常生活中会有诸多不便,出门对他们而言危机四伏。AI有可能成为他们...

百度飞桨半监督学习目标定位竞赛冠军方案分享

Posted: 31 Aug 2021 02:30 PM PDT

赛题介绍 赛题背景 监督学习模型的优异性能要以大量标注数据作为支撑,可现实中获得数量可观的标注数据十分耗费人力物力。于是,半监督学习逐渐成为深度学习领域的热门研究方向,只需要少量标注数据就可以完成模型训练过程,更适用于现实场景中的各种任务。 比赛任务 本次比赛采用IoU曲线作为评价指标,要求选手基于少量...

AI Studio精品项目合集 | NLP领域的Transformer实践

Posted: 23 Sep 2021 12:59 PM PDT

在2017年,Transformer模型由论文《Attention is all you need》提出,最开始被应用于机器翻译任务上并取得了很好的效果。它摒弃了传统LSTM的串行结构,使用了基于Self Attention的模型结构,具有更好的并行计算能力,这使得它在大规模数据模型训练方面更有优势。 后来基于Transformer结构的模型大放异彩,特别是在2018年...

Paddle.js & PaddleClas 实战 ——『寻物大作战』AI 小游戏

Posted: 26 Nov 2021 03:27 AM PST

1. 前言 AI 自诞生以来就应用在各个科技前沿领域,随着发展进程加快,在娱乐方面也有越来越多的趣味性游戏开始将AI融入其中。『寻物大作战』正是一款基于 AI 能力打造的趣味性小游戏,目的就是让玩家通过游戏的方式感受 AI 的魅力。 『寻物大作战』项目的背后所依赖的正是目前 AI 领域最热门的深度学习技术,通过一套 端...

OSCHINA 社区最新专区文章

Posted: 29 Nov 2021 01:26 AM PST

OSCHINA 社区最新专区文章


运维监控场景下,如何从OpenTSDB迁移到TDengine

Posted: 29 Nov 2021 01:06 AM PST

OpenTSDB是一个经典的时序数据库系统,它没有开发自己的存储引擎,而是基于HBase,对于已经有HBase基础服务的企业而言,降低了门槛。而且得益于其先发优势,OpenTSDB在运维监控领域有不少应用。不过也因为要依赖HBase,系统的性能、压缩效率逐渐成为瓶颈。随着业务系统规模的扩大,部署成本、运行效率等方面的问题日益严...

可视化DataEase使用的心由历程,运维人员的可以轻松上手的开源软件。

Posted: 28 Nov 2021 06:28 AM PST

前言: 关于DataEase,很早有所了解,是飞致云公司的开源产品,楼主曾经部署使用过他们家的Jumpserver开源堡垒机,KubeOperator多云管理平台,DataEase大数据大屏可视化BI(曾经的使用局限于部署层面,还没有把可视化数据进行呈现),这次双十一在北京出差的时间里,楼主下班后在酒店打开电脑开始重新部署起来了,目标是...

NDPQ(NDP+PQ),定义分布式数据库新方向

Posted: 28 Nov 2021 10:45 PM PST

摘要:云服务提供商构建新的云原生关系数据库系统,专门为云基础架构设计,通常采用将计算和存储分离到独立扩展的分布式层的设计。 本文分享自华为云社区《性能提升100倍!GaussDB(for MySQL)近数据处理(NDP)解锁查询新姿势》,作者: GaussDB 数据库。 业务增长对数据库吞吐量和响应能力提出新挑战 随着企业和政府机构将...

移动计算云分布式数据缓存服务,实现快速可靠的跨区域多活复制

Posted: 28 Nov 2021 06:23 PM PST

摘要:本文介绍了一种在移动计算云中扩展分布式数据缓存服务以实现跨区域多活复制的方案。 本文分享自华为云社区《移动计算云分布式数据缓存服务,实现快速可靠的跨区域多活复制》,作者: 敏捷的小智。 本文翻译自华为加拿大研所论文,英文原文链接:https://www.sciencedirect.com/science/article/pii/S187705092101...

带着问题读 TiDB 源码:Hive 元数据使用 TiDB 启动报错

Posted: 25 Nov 2021 07:59 PM PST

《带着问题读源码系列》- 开篇 在 TiDB 社区活跃较久的伙伴们应该知道,过去我们有被称为 24 章经的《TiDB 源码阅读系列文章》,也有面向 TiKV 的《TiKV 源码解析系列文章》以及 《Deep Dive TiKV 系列文章》。这些系列文章的内容非常深入,能够帮助大家从非常细节的原理入手了解 TiDB 以及 TiKV 的实现方式和基础原理。...

DBeaver 21.3.0 发布,可视化数据库管理平台

Posted: 28 Nov 2021 03:04 PM PST

DBeaver 21.3.0 现已发布。DBeaver 是一个免费开源的通用数据库工具,适用于开发人员和数据库管理员。 主要更新内容 数据查看器 过滤器配置对话框 UI 已修复(MacOS) 发现事件突出显示已修复(查找/替换) 长列调整大小的问题已修复 重叠列图标的问题已修复 图表查看器 连接自动布局已修复 在 MacOS 上修复了 SQL 脚本预...

OSCHINA 社区最新软件

Posted: 29 Nov 2021 01:05 AM PST

OSCHINA 社区最新软件


Vue Layui 组件库 layui-vue

Posted: 28 Nov 2021 10:05 PM PST

A component library for Vue 3 base on layui Vue 3.0 的 桌 面 端 组 件 库 , Layui 的 另 一 种 呈 现 方 式 快速上手 : Beta 获得 layui-vue 你只需要使用 npm 引入下述文件: npm install @layui/layui-vue 在 main.ts 中: import { createApp } from 'vue' import Layui from '@layui/layui-vue' import '@layui/layui-vue/lib/index.css' import App from './App.vue' createApp(App).use(Layui).mount('#app') 这是...

OSCHINA 社区最新讨论话题

Posted: 28 Nov 2021 11:16 PM PST

OSCHINA 社区最新讨论话题


thymeleaf select问题

Posted: 28 Nov 2021 06:57 PM PST

thymeleaf select 如何设置成可以输入和选择共存?

moran指数分析时,是否需要满足数据在空间上相邻?

Posted: 28 Nov 2021 08:38 PM PST

@酱肉包- 你好,想跟你请教个问题: 您好,看到您关于空间自相关的文章,想请教一下,如果待分析数据在地理空间上是不相邻的,比如 广东番禺,北京亦庄,浙江嘉善 三部分,将所有数据放在一个shapefile中进行Moran指数分析,是否是有价值的?是不是必须空间相邻的数据才可以用moran指数呢?感谢,期待回复!...

Android怎么显示数字的次幂

Posted: 28 Nov 2021 06:26 PM PST

Android中怎么以科学计数法显示数值,在10的右上角以角标的方式,如下图

ajax只返回了登陆成功信息,登陆成功后得信息如何返回

Posted: 28 Nov 2021 03:39 AM PST

问题遇到的现象和发生背景 //=============================以下是login.ctr.php文件========================================================== class Login extends Ctrl { protected function c_init($param = array()) { parent::c_init(); $this->mdl_login = Loader::...

mysql事务提交问题?

Posted: 28 Nov 2021 04:51 AM PST

修改某行的某个字段的时候设置成某一个值就会无法响应,设置其他数据就可以提交。然后查询都没有反应,通过查看锁状态发现是被锁了,解除锁后更新查询都正常了。对mysql的锁机制了解不深,是不是因为设置某个数值之前有一个相同的提交被锁了造成后面再设置同样数值的提交都会被锁,而设置其他值就没这个问题?

GoFrame的model.count在多表查询并设置fields时会出错

Posted: 28 Nov 2021 01:02 AM PST

@Fly的狐狸 你好,想跟你请教个问题:model := db.Table("user_station_tag m") //////////////////////////// model.InnerJoin("user_tag_content t", "t.object_id = m.id") model.InnerJoin("user_station_tag_type ty", "ty.id = t.type_id") model.Fields("ty.name,ty.id as tyid,m.tag_caption,t.type_id,t.type,...

OSCHINA 社区最新专区文章

Posted: 28 Nov 2021 11:10 PM PST

OSCHINA 社区最新专区文章


GoFrame的model.count在多表查询并设置fields时会出错

Posted: 28 Nov 2021 01:02 AM PST

@Fly的狐狸 你好,想跟你请教个问题:model := db.Table("user_station_tag m") //////////////////////////// model.InnerJoin("user_tag_content t", "t.object_id = m.id") model.InnerJoin("user_station_tag_type ty", "ty.id = t.type_id") model.Fields("ty.name,ty.id as tyid,m.tag_caption,t.type_id,t.type,...

Google 公布最新的 Open Source Peer Bonus 得主,TensorFlow 贡献者获奖最多

Posted: 16 Sep 2021 03:18 PM PDT

「Google Open Source Peer Bonus」是由 Google 推行的开源奖励计划,旨在奖励由 Google 员工所提名的外部开源贡献者,表彰这些外部开源贡献者对开源所做出的特殊贡献。近日,Google 公布了最新一轮的获奖者,此次共有 112 名获奖者,这些获奖者来自 33 个不同的国家和地区,也创造了 Google Open Source Peer Bonus 的一...

这款打怪升级的小游戏,7 年前出生于 GitHub 社区,如今在谷歌商店有 8 万人打了满分

Posted: 09 Sep 2021 05:41 PM PDT

![](https://img2020.cnblogs.com/blog/759200/202109/759200-20210909214234744-655307525.jpg) 今天我在 GitHub 摸鱼寻找新的"目标"时,发现了一个开源项目是 RougeLike 类的角色扮演游戏「破碎版像素地牢」(Shattered Pixel Dungeon)类似魔塔的游戏。 ![](https://img2020.cnblogs.com/blog/759200/202109/75920...

ELv2是一种什么样的存在?StarRocks为何惹众怒?

Posted: 12 Sep 2021 09:11 PM PDT

最近一个叫StarRocks的软件出圈了,这是一款MPP数据库软件,以前叫做DorisDB,源自Apache Doris,其厂商鼎石科技发表了一篇文章《StarRocks开源—携手未来,星辰大海!》,惹恼了一众开源人士,以至于有人写出了《对StarRocks真假开源之争的灵魂九问》,对StarRocks大加批驳,认为其所作所为实在令人不齿。另有一篇文章《...

Recent Questions - Mathematics Stack Exchange

Posted: 28 Nov 2021 11:08 PM PST

Recent Questions - Mathematics Stack Exchange


How to proof this conclusion? I don't know if it is related to ring homomorphism.

Posted: 28 Nov 2021 11:04 PM PST

Assuming $F$ is a number field, and $M_n(F)$ represents the set of all $n\times n$ matrixes on the number field $F$, $M_m(F)$ is defined similarly. Map $f:M_n(F)\to M_m(F)$ meets conditions below: 1) $f$ is injection, 2) $f(A+B)=f(A)+f(B)$, 3) $f(AB)=f(A)f(B)$, 4)$f(I_n)=I_m,f(0_n)=0_m$.Then how do we proof that $n| m$?

Shortest path in conformal maps of a surface

Posted: 28 Nov 2021 11:04 PM PST

My intuition tells me that the shortest distance between two points on the surface corresponds to a line segment joining the two points on the map of a surface. Since the path on the surface is same as the shortest path in the map. However, this turns out to be wrong.

Take for instance, the Beltrami-Poincare half-plane model of $\mathbb{H}^2$, the shortest path between two points seems to be an arc of a semi circle centered at somewhere on the horizon. Picture:

enter image description here

Why is the shortest distance not a straight line in the map here?

Probably I am missing something quite basic, but I just can't seem to figure it out.

Countable sets problem

Posted: 28 Nov 2021 11:04 PM PST

I'm stuck on this problem, and I'm afraid I don't have no idea how I would start it:

If S is a subset of the set of real numbers and if |x_1 + x_2 + ... + x_n|<=1 for all finite sets {x_1, x_2, ..., x_n} subset of S, then S is countable.

Any ideas are welcome, thank you!

Linear independence of permutations of a set

Posted: 28 Nov 2021 11:04 PM PST

Let $(a_1,a_2,..a_n)$ be some tuple of reals. I'm wondering if the set of permutations of the tuples always generates at least $n$ linearly independent vectors. Trivially, I have found that the all zeros tuple generates no L.I, vectors and all equal tuple generates only one L.I. vector.

Further, experimentation with some small examples leads me to believe that even if one $a_i$ is distinct then, $n$ L.I. vectors are generated. Is there a way to rigorously show this?

Where i am wrong? A question on uniformly continuous function in functional analysis.

Posted: 28 Nov 2021 11:01 PM PST

Given metric spaces $(X, d) $ and $(Y, d') $ , a mapping $T:X \to Y$ is uniformly continuous on $X$ iff for every Cauchy sequence $(x_n) $ in $(X, d) $, the sequence $ (Tx_n) $ is Cauchy in $(Y, d') $.

One sided implication (uniformly continuous function map Cauchy sequence to Cauchy sequence) is easy to prove.

But what about the converse.

I think it is false.

$f:\mathbb{R} \to \mathbb{R}$ defined by $$f(x) =x^2$$

maps Cauchy sequence to Cauchy sequence but this function is not uniformly continuous.

Please verify the proof that I upload as an image.

Is the proof correct?

Please see the proof

Probability : The emperor's death sentence

Posted: 28 Nov 2021 10:58 PM PST

please help, I don't understand how to do this. Click link

You are a prisoner sentenced to death. The emperor (who has sentenced you) offers you a chance to live by playing a simple game. He gives you 10 black marbles, 10 white marbles, and 2 empty bowls. He then says, "Divide these 20 marbles into these 2 bowls. You can divide them any way you like as long as you place all the marbles in the bowls. Then I will blindfold you, and ask you to choose a bowl, and remove ONE marble from that bowl you have chosen. You must leave the blindfold on the entire time, and must remove the first marble you touch. If the marble is white you will live, but if the marble is black, you will die."

1.If you put 5 black and 5 white marbles in each bowl, then complete the tree diagram (make sure you have written a probability on every branch!) and use it to determine your chance of living.

question about decomposition of positive terms series $\sum_{n=1}^\infty a_k$ where $a_k=b_k + c_k$

Posted: 28 Nov 2021 11:03 PM PST

let $\sum_{n=1}^\infty a_k$ be a series at positive terms. and with some positive free parameter x.

now suppose $a_k=b_k + c_k$ for all k. what can we say in general about the series by looking at $\sum_{n=1}^\infty b_k(x)$ and $\sum_{n=1}^\infty c_k$.

does it converge if and only if both of them converge? or in general we can't really say anything about such a series?

to give context if I may wasn't clear here's an example of what i mean:

$$\sum_{n=1}^\infty \frac{n^x+1}{\log(n)}, \quad x>0\tag{i}$$

notice:

$$\frac{n^x+1}{\log(n)}=\frac{n^x}{\log(n)} +\frac{1}{\log(n)}$$

then we can assure that the terms where (i) converges are the same where both of the series $\sum_{n=1}^\infty \frac{n^x}{\log(n)}$ and $\sum_{n=1}^\infty \frac{1}{\log(n)}$ converge? and those where (i) diverges are the same where at least 1 of the former 2 diverge?

thanks in advance

Regularity of a language checker

Posted: 28 Nov 2021 10:54 PM PST

I have to check if this language is regular or not:$$L = \{w(bb)^nw^R:w\in\{a,b\}^* \land n \in \mathbb{N}\}$$ My thoughts are if this language is regular so the RE for this is: $(11)^*$ where $w$ and $w^R$ are empty strings. But if this language is not regular, the pumping lemma doesn't work on this language since there are $2$ different exponents. What do you guys think? Is this language regular or not?

$\lim_{n\to\infty}\frac{n+\sqrt{n}+\sqrt[3]{n}+\cdots+\sqrt[n]{n}}{n}$

Posted: 28 Nov 2021 10:54 PM PST

How to calculate the limit of this sequence $$\lim_{n\to\infty}\frac{n+\sqrt{n}+\sqrt[3]{n}\cdots+\sqrt[n]{n}}{n}$$ is it convergent or divergent?

Is Heine's theorem realted to Bolzano-Weierstrass theorem?

Posted: 28 Nov 2021 10:44 PM PST

The Bolzano-Weierstrass theorem states that:

Any Bounded sequence has subsequences that converge to a finite limit.

Heine's theorem states that:

$\lim\limits_{n \to a} f(x)=L \ \iff \ \forall \ subseqeuences \ x_n \ s.t \ \lim\limits_{n \to \infty} x_n=a \ and \ x_n \ne a \lim\limits_{n \to \infty} f(x_n)=L$

For example, if we use $f(x)=\frac{sinx}{x}$ if we use the two subsequences one with all zeroes that indicate all the crossings two and one with all the peaks with decreasing amplitudes as $x \to \infty$ both tend to zero.

I know this is just one example. But I want to know if this is just coincidence, or are the two theorems related on anyway?

How to tackle the integral $\int_{0}^{\infty} \frac{\ln x}{x^{n}-1} d x$?

Posted: 28 Nov 2021 10:56 PM PST

In my post, I started to investigate the integral $\displaystyle \int_{0}^{\infty} \frac{\ln x}{x^{2}-1} d x$. Fortunately, $$\displaystyle \int_{0}^{\infty} \frac{\ln x}{x^{2}-1} d x =2 \int_{0}^{1} \frac{\ln x}{x^{2}-1} d x.$$

So we need only to evaluate the integral $J$ using series and integration by part. $\displaystyle \begin{aligned} J\displaystyle & = \int_{0}^{1} \frac{\ln x}{1-x^{2}} d x =\sum_{k=0}^{\infty} \int_{0}^{1} x^{2 k} \ln x d x=\sum_{k=0}^{\infty}\left(\left[\frac{x^{2 k+1} \ln x}{2 k+1}\right]_{0}^{1}-\frac{1}{2 k+1} \int_{0}^{1} x^{2 k+1} \cdot \frac{1}{x} d x\right) \\\displaystyle &=-\sum_{k=0}^{\infty}\frac{1}{(2 k+1)^{2}}=-\frac{\pi^{2}}{8} \end{aligned} \tag*{} $

$$\therefore \displaystyle \int_{0}^{\infty} \frac{\ln x}{x^{2}-1} d x =-2J=\frac{\pi^{2}}{4} $$

However, when I began to increase the power $n$, I found, in Wolframalpha, that there is a pattern for the integral$$ I_{n}=\int_{0}^{\infty} \frac{\ln x}{x^{n}-1} d x $$ $$ \begin{array}{|c|c|c|c|c|c|c|c|c|} \hline n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline I_{n} & \text { Diverges } & \frac{\pi^{2}}{4} & \frac{4 \pi^{2}}{27} & \frac{\pi 2}{8} & \frac{8 \pi^{2}}{25(5-\sqrt{5})} & \frac{\pi^{2}}{9} & \frac{\pi^{2}}{49} \csc ^{2}\left(\frac{\pi}{7}\right) & \frac{\pi^{2}}{64} \csc ^{2}\left(\frac{\pi}{8}\right) \\ \hline \end{array} $$ By the pattern, let's guess the formula for $I_n$ as $$ I_{n}=\left(\frac{\pi}{n}\right)^{2}\csc ^{2}\left(\frac{\pi}{n}\right). $$

How to prove it? Is it ifficult or interesting? Looking forward to your suggestions and proofs.

Why is modular arithmetic called "modular"?

Posted: 28 Nov 2021 10:39 PM PST

I think of modular in the context of "modular design" which is basically subdivided a system into self-contained chunks. modular is based on the word modules which are like self contained lessons or sections. There is almost a sense of functional programming here where you can think of "modular" as meaning "atomic" in the way that a pure function is the most distilled version of a black box yielding output from a given output.

Based on the above concept, here is my hypothesis regarding why modular arithmetic is called modular. If you do modular arithmetic on a given modulus, say $n$, then you are dividing the set of integers into $n-1$ discrete chunks, reminiscent of how a system is broken down in modular design.

show $X^{(0)}$ is a discrete finite subset of $X$

Posted: 28 Nov 2021 10:37 PM PST

If $(X,\mathcal{C})$ is a CW complex, then $X^{(0)}$ is a discrete finite subset of $X$.


Let $A\subset X^{0}$. For any cell $c\in\mathcal{C}$, let $X_c$ be a finite subcomplex that contains $\bar{c}$. Note that $A\cap X_c=X_c\setminus(X_c\cap A)$. As $X_c$ is finite, we have $X_c\setminus(X_c\cap A)$ is finite. Additionally, $X$ is Hausdorff, $A\cap X_c=X_c\setminus(X_c\cap A)$ is closed because finite set is closed in Hausdorff space. Thus, $A$ is closed by the weak topology. Moreover, $A\cap\bar{c}=A\cap(X_c\cap\bar{c})$ which is finite.


this is what I have so far, and I don't know how to move forward.

I don't know how to prove some class of models is whether an elementary class or an elementary class in the wider sense. How can I prove what it is?

Posted: 28 Nov 2021 10:28 PM PST

First some definitions: For a set Σ of L-sentences, Mod(Σ) denotes the class of all models that satisfy Σ. For a class M of models, we say it is EC if M=Mod(σ) for some sentence σ and ECΔ if M=Mod(Σ).

Problem. Let T be a theory having arbitrary large finite models. (For example, T can be axioms for groups, or fields, or linear orderings.) Let Kinf={M : M⊨T, Card(|M|) is infinite.} and Kfin={M : M⊨T, Card(|M|) is finite}.

Question.

(a) Kinf is ECΔ

(b) Kfin is not ECΔ

(c) Kinf is not EC

what is q & n in Primality Testing using Elliptic Curves

Posted: 28 Nov 2021 10:25 PM PST

Shafi Goldwasser and Joe Kilian's paper on Primality Testing using Elliptic Curves under the header "A PRIMALITY CRITERION USING ELLIPTIC CURVES" on page 9 contains a formula

$$\ q > n^\frac12+n^\frac14 + 1$$ and don't understand where the values of q and n are coming from.

Proof that a nonzero point is continuous for g(x)

Posted: 28 Nov 2021 10:23 PM PST

I have come across this problem in my math book for my numerical analysis class:

Let $g(x)=\sqrt[3]{x}$.

Prove that $g$ is continuous at a point $c \neq 0$.

I start my proof off the typical way for proving a continuous function:

Given some arbitrary $\epsilon > 0$, let $\delta=$ ... and then I get lost. I cannot find what my delta should be for the life of me. I am primarily struggling with the triangle inequalities for this problem, in order to find what our delta should be. Guidance is much appreciated!

Independence of long times coin toss model

Posted: 28 Nov 2021 10:35 PM PST

A coin is tossed independently $n$ times. The probability of heads at each toss is $p$. At each time $k (k = 2,3,\cdots,n)$ we get a reward at time $k+1$ if $k^{th}$ toss was a head and the previous toss was a tail. Let $A_k$ be the event that a reward is obtained at time $k$.

a.Are events $A_k$ and $A_{k+1}$ independent? b. Are events $A_k$ and $A_{k+2} independent?

In this problem as the event $A_k$ depends on the previous out comes so I think bit a will be dependant however bit b is independent. Is it the correct way to show.

Product, inverse, determinant, exponential of $n \times n \times n$ and $n \times n \times n \times n$ matrices

Posted: 28 Nov 2021 10:40 PM PST

There are many MO or MSE questions, some very popular, about the product of 3-D matrices (cubes) and 4-D matrices, and more. Of course they are considered as tensor operations, but so far, I haven't seen a non-trivial product of "cubes" ($n \times n \times n$ matrices) resulting in a cube. I propose examples here, indeed in any dimension, generalizing the standard 2-D case, and I am wondering if these examples exhaust all the nice possibilities. The objects investigated here have $n^d$ elements, all real numbers, and $d$ is called the dimension ($n$ is not called the dimension).

To cut it short, it seems to work quite nicely only if $n=2$ or $n=4$. First, define a product $A\cdot B = C$ of cubes (there are many possible definitions) by reducing it to 2-D, as follows:

  • An $n\times n\times n$ cube $A$ consists of $n$ (say horizontal) slices $A_1,\cdots,A_n$, each slice being a $n\times n$ matrix.
  • Let $\sigma_k$ be a permutation of $(1,\dots,n)$, and $A\cdot B=C$. Then $C_k = \sum_{j=1}^n \epsilon_{k,j} A_j B_{\sigma_k(j)}$, with $\epsilon_{k,j}\in\{-1,1\}$.

The choice for the $\sigma_k$'s and $\epsilon_{k,j}$'s is very important and discussed below. Note that the generic definition of $A\cdot B$ generalizes easily to any dimension $d>2$, that is to hypercubes and so on. In that case $A_k$ is an hyper-slice of dimension $d-1$, of $A$, and $A$ has $n$ such hyper-slices. The product is computed iteratively by going to lower and lower dimensions until we reach standard $n\times n$ matrices (dimension $=$ 2). It is a combinatorial problem.

Examples

I see only two cases that are interesting and non-trivial: the case $n=2$ and $n=4$, regardless of the dimension (cube, hypercube and so on). Are there any other? The case $n=2$ is related to complex numbers, and $n=4$ to quaternions.

For $n=2$, the $2\times 2 \times 2$ cube $A$ is equivalent to $A_1 + A_2i$, where $i$ is the imaginary unit. Since $$(A_1 + A_2i)\cdot(B_1+B_2i)=A_1 B_1 - A_2 B_2 + (A_1 B_2 + A_2 B_1) i,$$ we have

  • $C_1 = A_1 B_1 - A_2 B_2$
  • $C_2 = A_1 B_2 + A_2 B_1$

that is: $\sigma_1(1,2)=(1,2)$, $\sigma_2(1,2)=(2,1)$, $\epsilon_{1,1}=1,\epsilon_{1,2} = -1, \epsilon_{2,1}=1, \epsilon_{2,2}=1$.

So the case $n=2$ (for cubes) essentially corresponds to complex matrices, despite the elements being real numbers. The inverse, exponential function, or determinant of a $2\times 2\times 2$ cube can be computed easily. In particular, the identity cube has $A_1 = I$ and $A_2=0$ (respectively, the identity and the zero $2\times 2$ matrices).

The case $n=4$ can be handled in the same way if we replace complex numbers by quaternions. For other values of $n$ there is no great complex-like extension of real numbers in $n$ dimension, thus my chagrin. See however an attempt with $n=3$, here.

Do you know of other products, possibly even better than those mentioned here, for cubes, hypercubes and so on, especially if $n=3$ or $n>4$?

Projecting a band of a sphere onto a 2D surface

Posted: 28 Nov 2021 10:26 PM PST

For a craft project, I want to take a "band" of a sphere (i.e. the area between two latitudes) and project it onto a plane, so that I can fold the 2d shape onto the sphere and recreate the band in 3 dimensions.

The sphere I am working with has a radius of 13cm. The band I wish to project is the area between a great circle and a small circle with radius 11.2cm.

If my trig is correct, the distance between these two circles, following the surface of the sphere, is about 6.76cm.

visualization

I do not know how to perform a projection given this setup. From similar crafts I can see that one strategy is to create a sort of arced rectangle, which looks as though it could be constructed by aligning a circle and an offset of the same circle.

arced rectangle

However I am unsure how the arcs could be calculated.

Why is $\text{maximize} \frac{1}{\lVert x \rVert}$ equivalent to $\text{minimize}\ \lVert x \rVert^2$?

Posted: 28 Nov 2021 11:06 PM PST

I know it is possible to solve $\text{minimize}\ \lVert x \rVert^2$ instead of $\text{maximize} \frac{1}{\lVert x \rVert}$, since the former behaves better around zero. However, I am looking for a theorem or a rule that tells me this is allowed.

Edit: This is the objective of a constrained optimization problem. I just omit the constraints here.

Notation of derivative w.r.t. the multi-variable function argument of an univariate function

Posted: 28 Nov 2021 10:55 PM PST

Suppose I have a univariate function, whose variable is a multi-variable function, i.e. $$ f=f(g)\,,\quad g=g(x,y)\,.$$

Should I write the derivative of $f$ as $\frac{df}{dg}$ or $\frac{\partial f}{\partial g}$?

When using chain rule, which nontation is correct or better?

$$\frac{\partial f}{\partial x}=\frac{d f}{d g}\frac{\partial g}{\partial x}$$

or

$$\frac{\partial f}{\partial x}=\frac{\partial f}{\partial g}\frac{\partial g}{\partial x}$$

I saw the second notation (all partial derivative) on a book about solid mechanics, but $\frac{df}{dg}$ makes more sense to me.

Calculate the limit $\lim\limits_{n\to\infty }(1+\frac{1}{a_n})^{a_n}$ Given $a_n$ is an increasing monotone sequence of integers

Posted: 28 Nov 2021 10:47 PM PST

$\lim\limits_{n\to\infty }(1+\frac{1}{a_n})^{a_n}$ given $(a_n)$ is an increasing sequence of integers

NOTE - I noticed these 2 questions here (1) and here (2) but I believe that my question is a bit different because these questions answer only the case of $a_1 \geq 0$

according to the information we can understand that if $a_1 \geq 0$ then it is immediately solved as $\lim\limits_{n\to\infty }(1+\frac{1}{a_n})^{a_n} =e$ since then we can look at $a_n$ as in $a_n=n$ and then the limit would be just an identity $\lim\limits_{n\to\infty }(1+\frac{1}{n})^{n}=e$

otherwise what if $a_1 <0$? we will need to show that there exists an $N \in \Bbb N$ such that $a_N \geq 0$ we can also understand that $a_{n+1}-a_n \geq 1$ then for ever $n$ we get $a_{n+1}-a_n = (a_{n+1}-a_n)+(a_n-a_{n+1})...+(a_2 - a_1) \geq 1+1+1...+1 =n$

I do not know how to continue from here.. I usually have more ideas and stuff I tried on my posts but I really cannot figure out what to do here.

thanks for any help and tips!

What does mean of Topological distortion in perspective projection?

Posted: 28 Nov 2021 10:42 PM PST

I asked this question and I read from this websites that The points of the plane that is parallel to the view plane & also passes through the Centre of projection are projected to infinity by the perspective projection. When we join the point which is back of the viewer to the point which is front of the viewer then the line will be projected as a broken line of infinite extent. This is called the topological distortion.

enter image description here

I am not understanding what does mean of topological distortion!! And how the point behind the viewer projected to front of the viewer along the infinite line?

All pairs of letters (de Bruijn sequence with $n=2,k=52$)

Posted: 28 Nov 2021 10:26 PM PST

Suppose I'm designing a font and want to verify its kerning.

Ignoring punctuation, I want to generate a string made of $52$ symbols (uppercase A to Z and lowercase a to z), so that all possible letter pairs occur at least once.

I looked up similar problems, and it seems that what I want is a de Bruijn sequence. However, I couldn't find anything online relating to an alphabet size $k>9$.

How long would my de Bruijn sequence be, and how would I go about generating said sequence?

Minimal spanning set ("conical basis") for 2x2 Hermitian PSD (positive semi-definite) cone?

Posted: 28 Nov 2021 10:28 PM PST

A linear combination $ax + by$ is called conic(al) if $a, b \ge 0$ (cf. section 2.1.5 of Boyd, Vandenberghe). I.e. conic(al) combinations are just linear combinations where the coefficients are restricted to be non-negative.

Here I am treating the space of $2 \times 2$ Hermitian (complex) PSD matrices as a real vector space (i.e. scalars are real numbers, so saying coefficients are $\ge 0$ makes sense).

Question: Can every Hermitian PSD (positive semi-definite) matrix be written as the conic combination of rank-1 Hermitian PSD matrices? If so, is there a reference or a simple argument?

Attempt: Under that assumption, and via trial and error, I think the following might be a minimal spanning set for the $2 \times 2$ complex Hermitian PSD cone. It seems like none of them can be written as conic combinations of each other (even though they're linearly dependent), so all that would need to be shown is that every PSD matrix can be written as a conic combination of these six matrices.

$$ (A) \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}$$

$$ (B) \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}$$

$$ (C) \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}$$

$$ (D) \begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix}$$

$$ (E) \begin{bmatrix} 1 & i \\ -i & 1 \end{bmatrix}$$

$$ (F) \begin{bmatrix} 1 & -i \\ i & 1 \end{bmatrix}$$

Note that a linear basis for Hermitian matrices should have $n^2 = 4$ elements, whereas the above has $2n^2 - n$ elements. This is reflected in how the above set is linearly dependent, e.g. (C) = -(D) + 2(A) + 2(B), and (E) = -(F) + 2(A) + 2(B). But clearly neither of these are conic(al) combinations.

Obviously being linearly independent implies also being conically independent. So showing that the above set is minimal (assuming that every PSD matrix can be writen as a conical combination of them) requires showing that (D) and (F) cannot be written as conic(al) combinations of (A), (B), (C), (E), and/or that (C) and (E) cannot be written as conic(al) combinations of (A), (B), (D), (F).

This might follow from how (A), (B), (C), (E) form a basis for Hermitian matrices, as do (A), (B), (D), (F), and so by uniqueness of linear combinations with respect to a basis, e.g. (C) = -(D) + 2(A) + 2(B) is the unique way to write (C) as a linear combination of (A), (B), (D), (E) or (A), (B), (D), (F), it is not a conic(al) combination, so no such conic(al) combination exists?

Anyway as hinted above, is this isn't difficult to generalize to the $n \times n$ case, I would love to hear your thoughts about that too. Right now I am trying to understand "the qubit", so $2 \times 2$ case suffices for me.

Related question about minimal spanning sets for conic(al) combinations

Finding all polynomials $P(x) \in \mathbb R[x]$ such that $P(x)^2=4P\left(x^2-5x+1\right)+2$

Posted: 28 Nov 2021 10:53 PM PST

Find all polynomials $P(x) \in \mathbb R[x]$ such that $P(x)^2=4P\left(x^2-5x+1\right)+2$.

This comes from a no-solution class problem so it should have a definitive solution, unless my teacher wrongly wrote it as it is now.

Approach

This is like solving a functional equation, but only that it's a polynomial. I first thought I would solve for $x=x^2-5x+1$ or $x^2-6x+1=0$ which yields $x_1=3+2\sqrt2$ or $x_2=3-2\sqrt2$.

Which yields the value for $P(x_1)$ and $P(x_2)$. But then I couldn't proceed.

If $d>0$ and $ax^d$ is the leading term of $P(x)$, then $a^2x^{2d}=4ax^{2d}$, and thus $a=4$.

Another way I considered is using sequence to prove that there's infinitely many values of $P(x)=P(y)$ but that doesn't work either.

Any help is appreciated!

$S^1$-valued function on $T^n$

Posted: 28 Nov 2021 10:46 PM PST

Let $f:T^n\to S^1$ be a smooth function on the $n$-torus $T^n=S^1\times \cdots \times S^1$. The differential $df$ can be viewed as a closed 1-form on $T^n$ (not exact). Moreover, it should give a nonzero cohomology class $[df]$ in $H^1(T^n;\mathbb Z)$ in $\mathbb Z$-coefficients. Concerning the natural isomorphism $H^1(T^n;\mathbb Z)\cong \mathrm{Hom}(\pi_1(T^n),\mathbb Z)$, this should mean the map sending a loop $\sigma$ in $T^n$ to the integer $\mathrm{deg}(f\circ \sigma)$. (Note that $f\circ \sigma: S^1\to S^1$)

I believe all these are standard, but I fail to find a reference or write down enough details to convince myself. Could you help me to make this clear? Or, maybe I was mistaken somewhere?

Need Recommendation for High Level proof book

Posted: 28 Nov 2021 10:29 PM PST

I know how solve geometry, combinatorics, algebra/Precalc, and number theory non-proof problems pretty well. However, I lack the ability to prove theorems, certain parts of recursive functions (ex prove ,a2020 smaller than a2019-7)(first time using mathstackexchange srry bad formatting), certain geometric ideas, etc. I'm also bad at using AM-GM and other tools to prove inequalities.
I could get multiple books, if each books goes really in-depth into it's respective area(s).
A few examples of problems I am aiming to easily prove are here: PUMaC 2020 A(https://static1.squarespace.com/static/570450471d07c094a39efaed/t/6073d63922e7506b0307e748/1618204218125/2020_Indiv_Finals_A.pdf)
PUMaC 2020 B (https://static1.squarespace.com/static/570450471d07c094a39efaed/t/6073d63fce2041659f2a3cab/1618204223311/2020_Indiv_Finals_B.pdf).
While I'm not going for PUMaC tests, I do want to be able to prove these sorts of problems. If the book does contain several approaches to proof problems and normal problems, do recommend.

How to take integral of absolute value(x) on a Casio fx-991ms

Posted: 28 Nov 2021 11:03 PM PST

I don't know if this is the correct place for this question, if there is a more appropriate forum please let me know.

Trying to solve the probability density function which has an absolute value in it, how can I integrate an absolute value on a Casio fx-991ms calculator? In order to enter absolute value (x) I need to switch to Mode 2, but once I do that everything I entered for the integral disappears. If I try to do this in Mode 2 to begin with than the integral symbol simply does not work in Mode 2.

OSCHINA 社区最新软件

Posted: 28 Nov 2021 09:33 PM PST

OSCHINA 社区最新软件


OSHI 可视化实现 MooInfo

Posted: 28 Nov 2021 06:47 PM PST

MooInfo MooInfo是OSHI 的一种可视化实现,用于查看有关系统和硬件的信息。 如操作系统,进程,内存,CPU,磁盘,设备,传感器等。

支持硬件加速的像素帧缓冲区 pixels

Posted: 28 Nov 2021 06:59 AM PST

pixels 是一个小型的硬件加速像素帧缓冲区。 特性 构建于现代图形 API wgpu的基础上:Vulkan、Metal、DirectX 12、OpenGL ES3 对 DirectX 11、WebGL2 和 WebGPU 的支持正在进行中 可使用自己的自定义着色器来获得特殊效果 支持在完美像素边界上的硬件进行加速缩放 支持非方形像素纵横比 (WIP) 示例

Rust 静态分析工具 MirChecker

Posted: 28 Nov 2021 06:46 AM PST

MirChecker 是一个 Rust 静态分析工具。该工具可自动分析 Rust 编译器生成的中间代码 (MIR),并收集关于程序的数值与符号信息,然后通过约束求解技术生成诊断信息,对可能出错的代码输出警告信息。 MirChecker 与其他自动代码查错工具有以下不同: 利用静态分析的方法,可以最大限度地利用 Rust 强大的类型系统 考虑了 Rust 语言特性导致的其特有的错误类型 基于 Rust MIR 而不是 LLVM IR,最大限度地利用 Rust 编译器提供的类型...

x509 证书查看工具 certinfo

Posted: 28 Nov 2021 05:52 AM PST

certinfo 是一个 CLI 工具,用来查看 x509 证书信息。此工具与openssl x509 -in -text命令相似,不过它还支持处理链式、多文件和 TCP 地址。当使用 TCP 地址参数时,TLS/SSL 版本也会打印出来。 用法 certinfo [flags] [| ...] +---------------------------------------------------------------------------------------------------------------+ | optional flags ...

版本控制和同步服务工具 Configurator

Posted: 28 Nov 2021 05:09 AM PST

Configurator 是一个版本控制和同步服务,可让 Kubernetes ConfigMaps 和 Secrets 与 Deployment 保持同步。 Configurator 使用 CRD 来创建 CustomConfigMaps 和 CustomSecrets,它们依次创建带有后缀的 ConfigMaps 和 Secrets。当在 CustomConfigMap 或 CustomSecret 中检测到更改时,Configurator 会自动生成带有新后缀的新 ConfigMap,此功能就像 ConfigMap 的版本控制。 支持版本:k8s 1.16+...

Linux 内核网络调试工具 pwru

Posted: 28 Nov 2021 04:56 AM PST

pwru 是一个基于 eBPF 的工具,用于追踪 Linux 内核中的网络数据包,具有高级过滤能力。pwru 支持对内核状态进行细粒度的内省 (introspection ),方便调试网络连接问题。 下面的例子展示了在安装 IP 表规则后,curl 请求的数据包被丢弃: 用法 Usage of ./pwru: --filter-dst-ip string filter destination IP addr --filter-dst-port uint16 filter destination port --filter-func strin...

基于 Vite 的边缘渲染框架 Vitedge

Posted: 28 Nov 2021 03:53 AM PST

Vitedge 是一个 Vite 应用,也是用于 Vue 或 React 的边缘渲染框架。 Vitedge 会在边缘 worker 中预渲染第一个视图,并将其余部分作为 SPA 运行。这意味着它会带来良好的 SEO,同时保持 SPA 的快速路由和 DX。 特性 由 Vite 和 ES Modules 提供支持的超快开发和 HMR 在边缘进行渲染和缓存,以实现生产中的最大性能,此外缓存是可配置的。 默认情况下,每个页面都将其服务器数据作为 props 获取置。 使用 HTTP/2 服务器推送资源以...

轻量级 Rust 解析库 Yap

Posted: 28 Nov 2021 03:23 AM PST

Yap 是一个小型、零依赖的解析库,灵感来自 parser-combinator。它的目标是使解析字符串和切片变得容易,并且易于使用。 特性 示例丰富,提供的每个函数都有使用示例 以冗余为代价,优先考虑简洁性 支持在需要的地方返回用户定义的错误 公开所有底层函数 …… 用法 use yap::{ // This trait has all of the parsing methods on it: Tokens, // Allows you to use `.into_tokens()` on strings and slices, ...

云原生运维部署工具 TAT Agent

Posted: 27 Nov 2021 09:32 PM PST

腾讯云自动化助手 TAT 是云服务器的原生运维部署工具,可以远程执行 Shell、PowerShell、Python 等脚本。TAT Agent 是 TAT 产品的客户端程序,其运行于云服务器 CVM、轻量应用服务器 Lighthouse、黑石物理服务器2.0 CPM 内部,负责完成命令执行动作、并上报结果给服务端。 适用场景 通过自动化助手,无需登录服务器,也无需打开入站端口、SSH,便可以直接管理实例,批量、周期性执行 Shell 等命令。轻松完成运行自动化运维脚本、...

OSCHINA 社区最新专区文章

Posted: 28 Nov 2021 04:08 PM PST

OSCHINA 社区最新专区文章


Linux 5.17 将为 AF_UNIX 套接字提供延迟优化

Posted: 28 Nov 2021 10:15 AM PST

提交记录显示,Linux 5.17 将为 AF_UNIX 套接字提供延迟优化。 Linux 5.17 合并窗口即将开始,Net-next 分支中已经堆积了许多优化,包括一个大的 TCP 优化和一个用于网络代码中校验和计算的 csum_partial() 的改进。最新的优化是为那些使用 AF_UNIX 套接字进行本地进程间通信的人改进 AF_UNIX 代码路径。 该系列补丁由日...

英特尔准备为 Linux 提供 USI Stylus 支持

Posted: 27 Nov 2021 04:00 PM PST

提交记录显示,英特尔工程师提交了一份为 Linux 内核的 HID 子系统添加 USI 手写笔支持的征求意见补丁。 英特尔的开源驱动工程师一直致力于为 Linux 内核提供 USI 手写笔支持。通用手写笔计划 (USI) 旨在提供跨触摸屏设备的有源手写笔的互操作性,其目标是允许所有符合 USI 的手写笔跨设备工作。目前,USI 得到了谷歌等公...

Recent Questions - Stack Overflow

Posted: 28 Nov 2021 02:58 PM PST

Recent Questions - Stack Overflow


How to define optional element in regex pattern with quanteda's kwic?

Posted: 28 Nov 2021 02:57 PM PST

I am struggling to 'translate' a regex expression from stringi/stringr to quanteda's kwic function.

How can I get all instances of "Jane Mayer", regardless of whether she has a middle name or not. Note that I don't have a list of all existing middle names in the data. So defining multiple patterns (one for each middle name) wouldn't be possible.

Many thanks!

library(quanteda)  library(tidyverse)  txt <- c("this is Jane Alexandra Mayer",            "this is Jane Mayer",           "this is Jane Eli Mayer",            "this is Jane Burger")    txt_token <- tokens(txt)    my_pattern <- c("Jane .* Mayer")  kwic(txt_token, pattern=phrase(my_pattern), valuetype = "regex")  #> Keyword-in-context with 2 matches.                                                 #>  [text1, 3:5] this is | Jane Alexandra Mayer |   #>  [text3, 3:5] this is |    Jane Eli Mayer    |    my_pattern <- c("Jane .? Mayer")  kwic(txt_token, pattern=phrase(my_pattern), valuetype = "regex")  #> Keyword-in-context with 2 matches.                                                 #>  [text1, 3:5] this is | Jane Alexandra Mayer |   #>  [text3, 3:5] this is |    Jane Eli Mayer    |    my_pattern <- c("Jane.* Mayer")  kwic(txt_token, pattern=phrase(my_pattern), valuetype = "regex")  #> Keyword-in-context with 1 match.                                       #>  [text2, 3:4] this is | Jane Mayer |    my_pattern <- c("Jane . Mayer")  kwic(txt_token, pattern=phrase(my_pattern), valuetype = "regex")  #> Keyword-in-context with 2 matches.                                                 #>  [text1, 3:5] this is | Jane Alexandra Mayer |   #>  [text3, 3:5] this is |    Jane Eli Mayer    |          With `stringr` I'll would simply use: str_extract(txt, regex("Jane.* Mayer"))  #> [1] "Jane Alexandra Mayer" "Jane Mayer"           "Jane Eli Mayer"        #> [4] NA  

Created on 2021-11-28 by the reprex package (v2.0.1)

How to create an Android 12 color adaptive Icon pack?

Posted: 28 Nov 2021 02:57 PM PST

Can anyone help me find a script or tutorial on how to make a dynamic icon pack for Android 12 that changes icon color based on the wallpaper and dark mode?

how to iterate over a list using one liner msl?

Posted: 28 Nov 2021 02:56 PM PST

i have a list , and a tuple (start,end,interval) i am trying to iterate over the list and return the elements that are in list from start to end with interval steps . for example:

cutt [1,2,3,4,77,8,7] (1,5,2);  val it = [2,4,8] : int list;  

the problem is that i want to write a function that does this using one line only which means no recursic function and no if condition also no pattern matching

i began by thinking i can cutt the list first only to elements between start and end using :

fun cutt list1 (start,end,interval) = List.drop(List.take(list1 ,end+1),start);  

and now i want to use maybe foldl or foldr to only get elements in interval jumps , my problem is how to iterate over the list ?

How do I filter only numbers that contains decimal greater than .00 in python/pandas?

Posted: 28 Nov 2021 02:56 PM PST

How do I filter only numbers that contains decimal greater than .00 in python/pandas?

dct = {'Lineitem price':[4.00,5.65,1.22,8.00,10.78,7.00,2.85]  

Basically I would like to keep only the numbers 5.65, 1.22, 10.78 , 2.85 , this would be for a muuch larger dataframe, so this dictionary is just to summarize my problem...

How do I locate or generate the .NET source files for AWS CDK

Posted: 28 Nov 2021 02:56 PM PST

I'm trying to get the .NET source code, not the TypeScript source code. I've googled for quite a while and tried to dig through the main source code repository for documentation on this. Not finding answers.

What are the drawbacks of changing an internal python method?

Posted: 28 Nov 2021 02:55 PM PST

I believe I've gotten into a bad habit recently when working with python. Sometimes, an internal method doesn't have all of the features I want, so I redefine the method locally. For example, I wanted to use the filter() method to search for methods in a module.

items=(x if 'query' in x.lower() else False for x in dir(module))  

which returns a huge list. I wanted to filter this down with filter(), but the method seemed weirdly limited. The initial solution was:

items_filtered=filter(lambda x: x,items)  print([x for x in items_filtered.__iter__()])  

Which seems like more lines than I want. Also I didn't like that iter() wipes the array clean, which is frustrating for notebook environments like Jupiter. I redefined the filter method as:

_filter = filter  class filter(_filter):    def __init__(self,*args,**kwargs):      _filter.__init__(*args,**kwargs)      itr = self.__iter__      self.values = [x for x in self.__iter__()]      self.__itr__ = itr  

which allows the one liner to be

items=filter(lambda x,(x if 'query' in x.lower() else False for x in dir(module))).values  

This is obviously not the 'right' way to handle these situations, but will it break anything when used in the wrong way?

Can't get PHP to work on Mac Os 12 -- it shows the code when opening Safari

Posted: 28 Nov 2021 02:55 PM PST

I am trying to set up PHP on my Macbook M1 Air, and it won't work. I have followed every step of this guide, and when I run info.php on Safari, I can read the actual code instead of seeing PHP info:

https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions

Slow startup when extracting thumbnails from UDP live stream using FFMpeg

Posted: 28 Nov 2021 02:54 PM PST

I'm running the following command using FFMpeg to extract an image every 1 second from a UDP stream:

ffmpeg -i "udp://224.1.2.123:9001" -s 256x144 -vf fps=1 -update 1 test.jpg -y

This works well, but it takes about 5 seconds to actually start producing images. Is there any way to lower the startup time?

The UDP stream uses mpegts format and is encoded with H264/AAC.

Thanks!

PHP Regex the nested section based on defined parent

Posted: 28 Nov 2021 02:56 PM PST

I am trying to match a nested content section of the config based on the alias.

I have the base prototype working for matching single aliases over here: https://regex101.com/r/1vwKsx/1 (section correctly matched to: 'template_path_stack' =>)

HOWEVER, I want to select a section (which is re-used in the file) based on the section container. In the link above, I need to only match the section which is inside: controllers => factories.

The problem is that the regex matches both (the correct one and the one from the outside). https://regex101.com/r/IrV0SN/1

Current regex:

('factories' => )(\[((?>[^\[\]]++|(?2))*)\])  

Showing favicon while compiling with parcel

Posted: 28 Nov 2021 02:56 PM PST

I'm attempting to declare a favicon on my webapp which is compiled with parcel. From my project directory, my icon is located in static/icon.ico.

Using this in the head of my HTML did not display the icon.

<link rel="shortcut icon" href="/static/icon.ico">    

This StackOverflow post says I need to use parcel-plugin-static-files-copy with some settings in package.json to get it to compile properly, so I installed it in my project directory, and then added this to my package.json

  "staticFiles": {      "staticPath": [        {          "staticPath": "static/icon.ico",          "watcherGlob": "**"        }      ]    }  

I'm not returning any errors, but the icon doesn't display and I do get this warning when trying to open with Chrome after compiling with Parcel.

localhost/:1 Each dictionary in the list "icons" should contain a non-empty UTF8 string field "type".  localhost/:1 Each dictionary in the list "icons" should contain a non-empty UTF8 string field "type".  localhost/:1 Each dictionary in the list "icons" should contain a non-empty UTF8 string field "type".  localhost/:1 Each dictionary in the list "icons" should contain a non-empty UTF8 string field "type".  

What could be causing this?

How would I correctly format my blackjack python script because right now it is not how I want it [closed]

Posted: 28 Nov 2021 02:54 PM PST

In my script, the code runs properly and everything but it doesn't truly work like blackjack. When I run it, it prints out my 2 randomly assigned cards, then I have to hit or stay, but the problem is that in blackjack you're supposed to be able to see one of your opponent's cards before you choose to hit or stand. How could I incorporate this into my script?If it helps more copy and paste my script into python

from random import choice      def total(hand):      aces = hand.count(11)      t = sum(hand)      if t > 21 and aces > 0:          while aces > 0 and t > 21:                t -= 10              aces -= 1      return t    two=[]  cards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11]        while True:      player = []      player.append(choice(cards))      player.append(choice(cards))      playerbust = False      compbust = False          while True:          tp = total(player)          print ("You has these cards %s and your value is %d" % (player, tp))          if tp > 21:              print ("You busted!")              playerbust = True              break          elif tp == 21:              print ("\a nice you got a blackjack")              break          else:              hs = input("hit or stand (h or s): ").lower()              if 'h' in hs:                  player.append(choice(cards))              else:                  break          while True:          comp = []          comp.append(choice(cards))          comp.append(choice(cards))          while True:              tc = total(comp)                              if tc < 18:                  comp.append(choice(cards))              else:                  break          print ("the computer has %s which means they have %d" % (comp, tc))              if tc > 21:              print ("The computer busted")              compbust = True              if playerbust == False:                  print ("You win")            elif tc > tp:              print ("The computer wins!")          elif tc == tp:              print ("It's a draw!")          elif tp > tc:              if playerbust == False:                  print ("You wins!")                elif compbust == False:                  print ("The computer wins!")            break      print        exit = input("Press Enter to play again or no to quit ").lower()      if 'no' in exit:          break      print    print  print ("Thanks for playing")  

How to add an arrayList to this child class?

Posted: 28 Nov 2021 02:57 PM PST

Context - So there are two classes that uses inheritance. The EmployeeService is the parent class and the EmployeeInfo is the child class.

What do I need help with - So I am trying to insert an arrayList to the parent class that combines the information of the experience and position and makes a new arrayList called serviceList.

And when I call a super() in the child class, I should be able to call the arrayList rather than the String variables (experience, position).

To put it short, I should basically be able to pass an arrayList as the third parameter in the child class employeeInfo method instead of String experience or String position

Parent class -

public class EmployeeService () {      private String experience;      private String position;            public EmployeeService (String experience, String position) {          this.setExperience (experience);          this.setPosition(position);      }            public String getExperience() {          return experience;      }        public void setExperience(String experience) {          this.experience = experience;      }            public String getPosition() {          return position;      }        public void setPosition(String position) {          this.position = position;      }            public String toString() {          return "Experience - " + experience + "Position" + " - " + position;      }        }    

Child class -

public class EmployeeInfo () {      private String firstName;      private String address;            public EmployeeInfo (String firstName, String address,String experience, String position) {          super(experience, position);          this.setFirstName (firstName);          this.setAddress(address);      }            public String getFirstName() {          return firstName;      }        public void setFirstName(String firstName) {          this.firstName = firstName;      }            public String getAddress() {          return address;      }        public void setAddress(String address) {          this.address = address;      }            public String toString() {          return "Name - " + firstName + "Address" + " - " + address + super.toString();      }  }  

R: Count number of times B follows A using dplyr

Posted: 28 Nov 2021 02:55 PM PST

I have a data.frame of monthly averages of radon measured over a few months. I have labeled each value either "below" or "above" a threshold and would like to count the number of times the average value does: "below to above", "above to below", "above to above" or "below to below".

df <- data.frame(value = c(130, 200, 240, 230, 130),                   level = c("below", "above","above","above", "below"))  

A bit of digging into Matlab answer on here suggests that we could use the Matrix package:

require(Matrix)  sparseMatrix(i=c(2,2,2,1), j=c(2,2,2))  

Produces this result which I can't yet interpret.

[1,] | |  [2,] | .  

Any thoughts about a tidyverse method?

How to reduce a string by another string in Python?

Posted: 28 Nov 2021 02:56 PM PST

I would like to remove all characters from a first string s1 exactly the number of times they appear in another string s2, i.e. if s1 = "AAABBBCCCCCCD" and s2 = "ABBCCC" then the result should be s = "AABCCCD".

The following rather crude code can achieve this:

def reduce_string(s1, s2):      s = s1      for c in s2:          if c in s:              s = s.replace(c, "", 1)      return(s)    # examples  reduce_string("AAABBBCCCCCCD", "ABBCCC")  reduce_string("AAABBBCCCCCCD", "ABBCCCE")  

My question is, can the same be achieved by clever use of some built-in function or at least in a more elegant way? Thank you for all your answers!

python select the dataframe column with the oldest date for each user

Posted: 28 Nov 2021 02:57 PM PST

This question seems super easy but I just can't figure it out.

I have the following dataframe:

watched_df = pd.DataFrame([['Love Death Robots', '2016-01-29 14:04:22', 'Anna'],                      ['James Bond', '2016-02-29 14:04:22', 'Anna'],                     ['Lord of the Rings', '2016-09-29 14:04:22', 'BoB'],                      ['The Hobbit', '2016-10-29 14:04:22', 'Anna'],                     ['Beauty and the Beast', '2016-06-29 14:04:22', 'BoB']],                     columns=['Title', 'Date', 'Profile_Name'])  watched_df.head()  

For each user I want to know what is the 'Title' of the first movie the 'Profile_Name' has watched and on what 'date' it was.

So the wanted result is:

wanted_df = pd.DataFrame([['Love Death Robots', '2016-01-29 14:04:22', 'Anna'],                      ['Beauty and the Beast', '2016-06-29 14:04:22', 'BoB']],                     columns=['Title', 'Date', 'Profile_Name'])  wanted_df.head()  

I managed to get a dataframe that is indexed by the 'Profile_Name' and the respective oldest dates. But I cannot manage to add the 'Title' to the dataframe

C++ Weird File Line Read

Posted: 28 Nov 2021 02:56 PM PST

I'm new to C++ programming and trying to figure out a weird line read behavior when reading a line from a text file. For this specific program, I have to wait for the user to press enter before reading the next line.

If I hard code the file name, the file read starts at line 1 as expected:

#include <iostream>  #include <fstream>  using namespace std;    int main(void) {     ifstream in_file;     in_file.open("test.txt");       // read line by line     string line;       while (getline(in_file, line)) {        cout << line;        cin.get();     }       in_file.close();     return 0;  }  

I compile with g++ -Wall -std=c++14 test1.cpp -o test1 and get:

$ ./test  This is line one.  **user presses enter**  This is line two.  **user presses enter**  This is line three.  etc. etc.  

But when I add in the option to have the user type in a file name, the line read starts at line 2:

#include <iostream>  #include <fstream>  using namespace std;    int main(void) {     string filename;     cin >> filename;          ifstream in_file;     in_file.open(filename);       // read line by line     string line;       while (getline(in_file, line)) {        cout << line;        cin.get();     }       in_file.close();     return 0;  }  

The same compile command gives me:

$ ./test2  test.txt  This is line two.  **user presses enter**  This is line three.  **user presses enter**  This is line four.  etc. etc.  

Am I missing something here? I have no idea why it starts reading at line 2 when I add in the code to specify a file name. Am I not finishing the cin statement properly or something?

Thanks!

LazyVStack - row onAppear is called early

Posted: 28 Nov 2021 02:56 PM PST

I have a LazyVStack, with lots of rows. Code:

struct ContentView: View {      var body: some View {          ScrollView {              LazyVStack {                  ForEach(0 ..< 100) { i in                      Text("Item: \(i + 1)")                          .onAppear {                              print("Appeared:", i + 1)                          }                  }              }          }      }  }  

Only about 40 rows are visible on the screen initially, yet onAppear is triggered for 77 rows. Why is this, why is it called before it is actually visible on the screen? I don't see why SwiftUI would have to 'preload' them.

Is there a way to fix this, or if this is intended, how can I accurately know the last visible item (accepting varying row heights)?

Python Logging Equal Length String of Log Level

Posted: 28 Nov 2021 02:55 PM PST

When using the logging module in python, displaying the logging level makes them all different lengths. With using a formatting string of "[%(levelname)s] - %(message)s", the log file looks like this:

[DEBUG] - Message  [INFO] - Message  [WARNING] - Message  [ERROR] - Message  [CRITICAL] - Message  

However, I would really like it if the log levels took up the same amount of space. Is there a way to make the output look similar to this:

[  DBUG  ] - Message  [  INFO  ] - Message  [  WARN  ] - Message  [  EROR  ] - Message  [CRITICAL] - Message  

Whether that entails shortening the level names, or just adding padding to the sides of the names doesn't really matter to me. Just some way of getting everything to line up after the level name is what I'm after.

How to arrange plots in specific positions on a grid in R?

Posted: 28 Nov 2021 02:56 PM PST

I am trying to plot multiple plots (of different sizes) onto a grid, using specific coordinates. To do this, I am creating a treemap using the treemap package to get coordinates and then, using these coordinates, Im trying to place my individual plots. Hopefully my example below will explain better my problem.

To begin, I create some barplots and then, I create a treemap, like so:

library(ggplot2)  library(treemap)  #create data  df <- data.frame(var1 = c("A", "B", "C"),               var2 = runif(3),               var3 = runif(3),               var4 = runif(3),               size = c(10, 5, 3),               labels = c(1:3))  # Basic barplot  p1 <- ggplot(data=df, aes(x=var1, y=var2)) +     geom_bar(stat="identity")  p2 <- ggplot(data=df, aes(x=var1, y=var3)) +     geom_bar(stat="identity")  p3 <- ggplot(data=df, aes(x=var1, y=var4)) +    geom_bar(stat="identity")    #create treemap  tm <- treemap(df,         index = "labels",         vSize = "size",         palette = "Set2")  

If we take a look at the treemap object tm, we can see that it provides the coordinates of the treemap shown below, where x0, y0, w, and h are the coordinates.

> tm$tm    labels vSize vColor stdErr vColorValue level        x0    y0         w     h   color  1      1    10      1     10          NA     1 0.0000000 0.000 0.5555556 1.000 #66C2A5  2      2     5      1      5          NA     1 0.5555556 0.375 0.4444444 0.625 #FC8D62  3      3     3      1      3          NA     1 0.5555556 0.000 0.4444444 0.375 #8DA0CB  

treemap

So, what Im trying to do is to take my three barplots p1,p2,and p3 and place them into the treemap so that p1 will be in position 1 of the treemap.... p2 will be in position 2 etc...

For clarity, My desired result would look something like this: treemap of plots

Any suggestions as to how I could do this? I tried using the patchwork package but ran into issues of the plots overlapping... but im open to suggestions using any package (eg gridExtra or just ggplot)

EDIT to clarify things a little, as per the answer given by Peter below in relation to the patchwork package, I cant manually input the coordinates as the plot layout (I was originally using the area function in patchwork and inputting the coordinates of the treemap into the area function). But, as mentioned in the comments below, if I have numerous barplots, and the size and shape of the treemap changes, then I cant manually input the layout values. I am trying to find a way to automate the process

Impoting specific Class from a Python module with `importlib`

Posted: 28 Nov 2021 02:54 PM PST

How would one go about importing a specific Class from a Python module using its path?

I need to import a specific Class from a Python file using the file path.
I have no control over the file and its completely outside of my package.


file.py:

class Wanted(metaclass=MyMeta):      ...    class Unwanted(metaclass=MyMeta):      ...  

The Metaclass implementation is not relavant here,
however, I will point out that its part of my package and I have full contol over it.

import example:

spec = importlib.util.spec_from_file_location(name='Wanted', location="path_to_module/mudule.py")  module = importlib.util.module_from_spec(spec)  spec.loader.exec_module(module)  

This works, and Wanted is imported.
The problem is that Unwanted is also imported.
Infact, as long as there ANY srt value given for name(including empty string)
both Wanted & Unwanted are imported from the module.

This has the same effect as in the example before, where both Wanted & Unwanted are imported:
importlib.util.spec_from_file_location(name='random string', location="path_to_module/mudule.py")

I'm not looking for a specific solution using importlib
and any reasonable way will do.
I will point out that I dont have a need of using the Class when its imported,
I only need the import to happen and my Metaclass will take care of the rest.

sorting odd number in a new array, output problem

Posted: 28 Nov 2021 02:57 PM PST

to store odd numbers from a user inputed array(arr) in a new array(arr1), then printing. run and see output first

#include <stdio.h>  int main()  {      int i;      int arr1[100];      int arr[5] = {2, 3, 8, 9, 11};      for (i = 0; i <= 5; i++)      {          for (int x = 1; x < 12; x++)          {              if (x == arr[i])              {                  arr1[i] = arr[i];              }              x += 1;          }      }      for (i = 0; i < 5; i++)      {          printf("%d\n", arr1[i]);      }        return 0;  }  

Making a histogram from Json data

Posted: 28 Nov 2021 02:55 PM PST

I have data in JSON format that looks something like this

{     "ts": 1393631983,     "visitor_uuid": "ade7e1f63bc83c66",     "visitor_source": "external",     "visitor_device": "browser",     "visitor_useragent": "Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16",     "visitor_ip": "b5af0ba608ab307c",     "visitor_country": "BR",     "visitor_referrer": "53c643c16e8253e7",     "env_type": "reader",     "env_doc_id": "140222143932-91796b01f94327ee809bd759fd0f6c76",     "event_type": "pagereadtime",     "event_readtime": 1010,     "subject_type": "doc",     "subject_doc_id": "140222143932-91796b01f94327ee809bd759fd0f6c76",     "subject_page": 3  } {      "ts": 1393631983,      "visitor_uuid": "232eeca785873d35",      "visitor_source": "internal",      "visitor_device": "browser",      "visitor_useragent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36",      "visitor_ip": "fcf9c67037f993f0",      "visitor_country": "MX",      "visitor_referrer": "63765fcd2ff864fd",      "env_type": "stream",      "env_ranking": 10,      "env_build": "1.7.118-b946",      "env_name": "explore",      "env_component": "editors_picks",      "event_type": "impression",      "subject_type": "doc",      "subject_doc_id": "100713205147-2ee05a98f1794324952eea5ca678c026",      "subject_page": 1  }  

My task requires me to find subject_doc_id that matches an input from user and then display a histogram showing the countries in which that document has been viewed.

I have been able to read through the data that with my code and I am also familiar with how to plot a histogram but I need help on how to count the countries and display that in the histogram.

For example here in the data above "visitor_country":"MX" and "visitor_country":"BR" exist so I want the count of each country.

Any ideas on how I can achieve that?

memcpy() is faster than "direct" memory access?

Posted: 28 Nov 2021 02:54 PM PST

I need to compute the MD5 hash of a large (e.g. several GB) block of memory.

Data is already loaded in memory. And physical RAM is bigger than data, so nothing is swapped out (presumably). Consequently, the most straight-forward approach is to simply pass the base address and the total size of the memory block into a single invocation of the md5_update() function and that's it. But I found this solution to be rather slow!

By a lot of testing, I found that stepping trough the memory block, with a step size of 8 Byte (64-Bit), and using memcpy() to "load" small chunks (8 byte each) from that memory block into a local variable of type uint64_t, which then are passed individually into repeated calls of md5_update(), is actually a whole lot faster! I mean like 5+ times faster.

So, can anybody explain to me: How can it be that, even with the "overhead" of the additional copy operations (and also many more small md5_update() invocations), the memcpy() approach still appears to be many times faster than the simple "direct" (linear) memory access?

My first idea was that memcpy() may do some "smart" prefetching to get chunks of bytes more quickly from RAM into CPU cache, whereas md5_update() interneally just iterates over the given memory range in a byte-by-byte fashion. So I changed my "stepping" loop to not use memcpy() but instead pass 8 byte chunks "directly" from the memory block into md5_update(). Additionally I added _mm_preftech() to prefetch each chunk before it is passed into md5_update() function. But this came out exactly as slow as passing the whole block into md5_update() at once!

Only with the memcpy() and an additional local variable as "buffer" I can get a huge speed up.


Original "slow" version:

void test(const uint8_t *const data, const size_t size, uint8_t *const digest)  {      md5_context_t ctx;      md5_init(&ctx);      md5_update(&ctx, data, size);      memcpy(digest, md5_finalize(&ctx), 16U);  }  

"Fast" version with memcpy():

void test2(const uint8_t *const data, const size_t size, uint8_t* const digest)  {      const uint8_t* p;      uint64_t temp;      md5_context_t ctx;      const uint8_t* const end = data + size;      md5_init(&ctx);      for (p = data; p < end; p += sizeof(uint64_t))      {          memcpy(&temp, p, sizeof(uint64_t));          md5_update(&ctx, (const uint8_t*)&temp, sizeof(uint64_t));      }      memcpy(digest, md5_finalize(&ctx), 16U);  }  

Please assume that the above sample code is called with a pointer to the base address and the size of a large block of memory that is already allocated in the RAM (heap space).

Note: Tested with VS2022 as well as VS2017. Always in "Release" mode (/O2). It was tested on my main develpment machine with Windows 11 and also on an older Windows 8.1 machine.

Note #2: I used the delta of clock() before/after whole computation to compare speeds.


[UPDATE] Please see a full example here:

Sample output:

Computing hash #1, please wait...  Done.    4591E000A32043C6EBF7E63647786C9B  Time #1: 844582                    <-- direct memory access    Computing hash #2, please wait...  Done.    4591E000A32043C6EBF7E63647786C9B  Time #2: 123811 (0.15)             <-- with memcpy(), about ~6x faster!  

Accessing objects with same id

Posted: 28 Nov 2021 02:55 PM PST

For the sake of reproducibility im reusing an object multiple times rather than creating a new one,

Im adding the Factory object into the main Layout and using the remove button i can remove the added object,

But if i add 2 or more objects into the Layout the remove function only works for the last added object

So is there any mechanism that can generate a unique id for an object which can be then used to delete it

Code

from kivymd.app import MDApp  from kivy.lang import Builder  from kivy.factory import Factory     kv='''    <Image_1@BoxLayout>:        orientation:'vertical'      id:img_1         Image:          source:"/storage/emulated/0/Download/download (37).jpeg"      Button:          text:"remove"          on_press:app.remove()             BoxLayout:      orientation:'vertical'                                      GridLayout:          cols:1          id:sc_grid                    Button:              size_hint:None,None               text:"add"              on_press:                  app.add_1()                                          '''    class MyApp(MDApp):            def build(self):          return Builder.load_string(kv)            def add_1(self):          self.Image_1=Factory.Image_1()          self.root.ids.sc_grid.add_widget(self.Image_1)      def remove(self):          self.root.ids.sc_grid.remove_widget(self.Image_1)            MyApp().run()  

Is it possible to make v-for variables dynamic in vue?

Posted: 28 Nov 2021 02:57 PM PST

<div class="col-3" v-for="n in 5"  :key="n">        <h3>Table {{n}}</h3>        <draggable class="list-group" :list="`list${n}`" group="people" @change="log">          <div            class="list-group-item"            v-for="`(element, index) in list${n}`"            :key="element.name"          >            {{ element.name }} {{ index }}          </div>        </draggable>      </div>  

Why can't I set the v-for or :list as a concatenated string? Is there any way around this?

Full code:

<template>    <div class="row">      <component      v-for="(component, index) in components"      :key="index"      :is="component"    />      <div class="col-3" v-for="n in listNumber"  :key="n">        <h3>Table {{n}}</h3>        <draggable class="list-group" :list="list${n}" group="people" @change="log">          <div            class="list-group-item"            v-for="(element, index) in list${n}"            :key="element.name"          >            {{ element.name }} {{ index }}          </div>        </draggable>      </div>      </div>  </template>    <script>  import draggable from "vuedraggable";  let id = 1;  export default {    name: "two-lists",    display: "Two Lists",    order: 1,    components: {      draggable,      list:[],    },    data() {      return {                list1: [          { name: "John", id: 1 },          { name: "Joao", id: 2 },          { name: "Jean", id: 3 },          { name: "Gerard", id: 4 }        ]        },        {        list2: [          { name: "Juan", id: 5 },          { name: "Edgard", id: 6 },          { name: "Johnson", id: 7 }        ],            listNumber: 3,      }    },    created(){        console.log(this.list);      },    methods: {            add: function() {        this.list.push({ name: "Juan" });      },      replace: function() {        this.list = [{ name: "Edgard" }];      },      clone: function(el) {        return {          name: el.name + " cloned"        };      },      }  };  </script>  

Using A* with target ouside graph

Posted: 28 Nov 2021 02:57 PM PST

My goal is to find the shortest path between A and B but B might be outside of the known graph. Currently my cost function works perfectly and heuristics function is 3D euclidean.

To solve the problem of target might be outside of the graph, I've tried to exit the algorithm when priority value stopped changing a certain time but that didn't worked. The algorithm spitted out a random path.

The reason why I don't select a node that is closest to the target is that if I select that algorithm will try to reach that point for certain. In my application I will rerun the algorithm when new information comes (i.e. update to the graph that might include the target).

So what I need is to find a path that is closest to target outside graph with least cost. I don't expect a code or whatsoever as an answer but any comment on how this kind of problem might be solved is greatly appreciated.

Below, I've added my A* implementation, PriorityQueue is just an wrapper for heapq.

def a_star_search(mesh, start, goal):      frontier = PriorityQueue()      frontier.put(start, 0)      came_from = {}      cost_so_far = {}      came_from[start] = None      cost_so_far[start] = 0        while not frontier.empty():          current = frontier.get()            if current == goal:              break            for i, next in enumerate(list(mesh.neighbors(current))):              new_cost = cost_so_far[current] + mesh.cost(current, next)              if next not in cost_so_far or new_cost < cost_so_far[next]:                  cost_so_far[next] = new_cost                  priority = new_cost + mesh.heuristic(next, goal) / mesh.unit                  frontier.put(next, priority)                  came_from[next] = current        return came_from, cost_so_far  

Example result when target is inside graph Example result when target is inside graph

How to run @Async method inside the @Scheduled one

Posted: 28 Nov 2021 02:54 PM PST

I have read many questions and answers about using @Scheduled with @Async in Spring but no one resolves my problem and my asynchronous method still runs single-threaded. So here is my Configuration class:

@EnableScheduling  @EnableAsync  @Configuration  @RequiredArgsConstructor  public class SchedulerConfiguration {        private final ThreadPoolProperties threadPoolProperties;        @Bean      public TaskExecutor commonTaskExecutor() {          ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();          taskExecutor.setCorePoolSize(threadPoolProperties.getCorePoolSize()); // 10          taskExecutor.setMaxPoolSize(threadPoolProperties.getMaxPoolSize()); // 20          taskExecutor.setQueueCapacity(threadPoolProperties.getQueueCapacity()); // 5          taskExecutor.setThreadNamePrefix("TEST");          taskExecutor.initialize();          return taskExecutor;      }  }  

Then we have a bean with the @Scheduled method:

@Component  @RequiredArgsConstructor  public class ScheduledTask {        private final ConfirmReservationTask confirmReservationTask;        @Scheduled(cron = "${booking.scheduler.confirmReservationsCron}")      public void process() {          confirmReservationTask.confirmReservations();      }  }  

And finally, another bean (to avoid self-injection and proxy problems with asynchronous processing) with @Async method:

@Log4j2  @Component  @RequiredArgsConstructor  public class ConfirmReservationTask {        private final ReservationService reservationService;        @Async("commonTaskExecutor")      public void confirmReservations() {      ...      }  }  

unfortunately, this solution works in only one thread, however, the method uses the correct ThreadExecutor. How to solve it?

How to install RStudio on Raspberry Pi(RaspbianOS)

Posted: 28 Nov 2021 02:55 PM PST

How to install RStudio on RaspbianOS?!! I have tried Ubuntu MATE 64 and 32 bit but neither work! Even wget or using the installer (by installer I mean Pi-gpk-dbus-service) or nothing works! It says something like Failed to install because some package is missing. But I do have have R-Base and it works on neither Ubuntu or RaspbianOS! So I can infer the issue is with my Raspberry Pi. But how do I solve this issue? How to actually install RStudio on a Raspberry Pi(RaspbianOS)? Please let me know if it is even possible to install RStudio on a Raspberry Pi.

Spring feature OutputCapture does not work in valid spring boot version

Posted: 28 Nov 2021 02:57 PM PST

I cannot use the feature with OutputCapture within JUnit testing. I want to use this feature to see some log messages. If I tried to include the class package org.springframework.book.test.rule.OutputCapture in IDEA it shows me warn message "No suggestions". So that I am not able to access to outputCapture class (even test package is not visible).

As I found out on this website this class is supported since version 1.3. However I am using correct spring boot version 1.5.

import org.junit.Rule;  import org.junit.Test;  import org.springframework.boot.test.rule.OutputCapture; THIS IS NOT RECOGNIZED    import static org.hamcrest.Matchers.*;  import static org.junit.Assert.*;    public class MyTest {        @Rule      public OutputCapture capture = new OutputCapture();        @Test      public void testName() throws Exception {          System.out.println("Hello World!");          assertThat(capture.toString(), containsString("World"));      }    }  

What is wrong?

Django modelform NOT required field

Posted: 28 Nov 2021 02:55 PM PST

I have a form like this:

class My_Form(ModelForm):      class Meta:          model = My_Class          fields = ('first_name', 'last_name' , 'address')  

How can I put the address field as optional?

OSCHINA 社区最新专区文章

Posted: 28 Nov 2021 02:32 PM PST

OSCHINA 社区最新专区文章


mysql事务提交问题?

Posted: 28 Nov 2021 04:51 AM PST

修改某行的某个字段的时候设置成某一个值就会无法响应,设置其他数据就可以提交。然后查询都没有反应,通过查看锁状态发现是被锁了,解除锁后更新查询都正常了。对mysql的锁机制了解不深,是不是因为设置某个数值之前有一个相同的提交被锁了造成后面再设置同样数值的提交都会被锁,而设置其他值就没这个问题?

Recent Questions - Ask Different

Posted: 28 Nov 2021 01:47 PM PST

Recent Questions - Ask Different


How to retrieve shared iCloud Link

Posted: 28 Nov 2021 12:05 PM PST

iOS offers to share pictures via iCloud Link. I hand-picked 15 photos and shared them with another iPhone user via iMessage. Now I'd like to share these 15 photos further with an Android user.

How can I retrieve the previously created iCloud Link? In the Messages app, when I long-press and choose Copy, it only copies the selected picture. I'm looking for a way how to copy the iCloud Link to be able to further share all 15 pics.

Is this possible? Or do I have to hand-pick those 15 pics again?

Is it possible to recover data from nvme hdd? [closed]

Posted: 28 Nov 2021 11:24 AM PST

The NVME hdd from my macbook pro stops working 1 or 2 minutes after booting freezing everything. Is there a way to make it work for more time and transfer the data I want? Like, is there some sort of workaround/ thanks

How to hide all toolbars in Excel?

Posted: 28 Nov 2021 11:52 AM PST

I have disabled the Formula Bar and the Ribbon :

enter image description here

But Excel still shows a bunch of tools at the top:

enter image description here

I want to de-clutter / simplify the view to only the data and the Menu itself . How can that be done?

Is it possible to disable all links in received text messages?

Posted: 28 Nov 2021 10:17 AM PST

My elderly mother got phished. Luckily, I got to the message before she did. The message just said

Sur La Table blah blah blah link.

I would like that to just be:

Sur La Table blah blah blah example.com

What I'd like is for that link to just be text, no link. That way it would be difficult for her to accidentally or impulsively tap on it. Is there any way to do this?

Trying to get a new build validated I get the error message "App Store connect operation error Unable to process app at this time due to general error [closed]

Posted: 28 Nov 2021 08:56 AM PST

I get this error message after sucessful execution of several pre steps in the end again and again (paying data and contract status were checked).

MBP no audio at all

Posted: 28 Nov 2021 07:52 AM PST

My MBP internal audio suddenly started making a really unexpected static noise and then silenced, the audio stopped working, the headphone port also does not work. If I shutdown this computer for a while the audio seems to work again (for a while then the noise repeats and audio shuts down). The OS doesn't recognise any audio outputs, i.e. the icon at the taskbar is grayed out. If I plug an HDMI on and audio capable device (receiver, monitor) it works with video only, the audio over HDMI option isn't presented and does not work. Bluetooth audio works. I haven't tried hooking a USB "sound card" yet.

I'm surprised HDMI audio did not work, perhaps it shares the same hardware controller? Could this be a software bug?

MacBook Pro (Retina, 15-inch, Mid 2015)  2,2 GHz Intel Core i7  16 GB 1600 MHz DDR3  Intel Iris Pro 1536 MB    macOS 10.14.6 (18G9323)  

Security of Parallels or Wine [closed]

Posted: 28 Nov 2021 08:26 AM PST

I want to run an .exe file on macOS. I read about using Parallels or wine but I am concerned about the security as I am going to enter personal data into the application. So how exactly does Parallels or Wine use the data I enter to translate it to windows logic?

Battery not charging

Posted: 28 Nov 2021 06:12 AM PST

I think I went through all "battery is not charging" posts already.

  1. SMC Reset: https://support.apple.com/en-ca/HT201295
  2. Battery Health does not have a button "Manage Battery Longevity" https://support.apple.com/en-gb/HT211094
  3. There is not "charge to full now" when clicking on the battery icon
  4. I tried unplug/replug, reboot, searched all settings

and yet:

enter image description here

None of the above worked. Do you have any other idea?

MacBook Air 2020 change screen brightness limit in macOS

Posted: 28 Nov 2021 04:14 AM PST

As several tests pointed out, the display of the MacBook Air 2020 (13.3") can deliver more than the official 400 nits of brightness with a non-Apple OS. The MPA display seems to be identical to the display the MacBook Pro 2020 (13.3") is using, which has an official maximum brightness level of 500 nits.

So it's clear that there is just an artificial max brightness limit on OS level for the MBA to further justify the higher price of the MBP. Now we just have to find the place where this limit is stored in the OS and how to adapt it. Did anyone look into that? This github project found out several undocumented settings already, but it doesn't seem to be able to change the upper limit.

What is the technical explanation for why Archive Utility can break certain apps, while other unarchivers won't?

Posted: 28 Nov 2021 08:48 AM PST

I just experienced this issue described in this answer.

I had downloaded a zip file containing a macOS app, and first unzipped it with Archive Utility, when trying to open the app, I got the error that it "could not be opened" (with no further clarification) just like in the Q&A linked to above.

However, when I used Keka (third party archive software) to unzip, the app worked just fine.

What is the technical explanation for this? Aren't zips and other archives supposed to come out literally the same, byte for byte? How can one unarchiver break the app, but not the other?

I use Catalina on an Intel Mac.

5.1 audio from MBP USB-C to HDMI

Posted: 28 Nov 2021 12:34 PM PST

I am struggling to get surround sound from my 2020 MacBook Pro (Intel version).

I also have a 2015 MBP that has an HDMI port which I connect to my Denon AVR and it gives me glorious Dolby/DTS 5.1 whilst passing the visuals to my TV. So I know my media is fine.

My 2020 MBP only has USB-C ports. So I first tried with this USB hub that has an HDMI port. My AVR only sees 2 channel audio and the Midi app in MacOS only shows 2 channels being available.

I have also tried this USB-C to HDMI cable and get exactly the same results.

The manufacturer of the 2nd cable couldn't get it working either and issued a full refund.

So how can I get HDMI surround sound from my 2020 MBP?

I've read it could be an issue with how the USB-C signal is being converted and maybe using DisplayPort as the middle man, but is this a quirk of the MBP or the adapters?

enter image description here

Bootcamp control panel causes BSOD in early 2011 MacbookPro with Windows 11

Posted: 28 Nov 2021 05:49 AM PST

Each time I open the Boot Camp control panel, I get a BSOD. I want to open it in the first place to set the function keys to change the brightness, volume etc. I am not sure if I'm doing something wrong or missing something. Could someone help me with:

  1. Enabling the function keys to control brightness, volume etc. in Win 11 and
  2. Resolving the BSOD issue that comes up when Bootcamp.exe is opened.

Here is the procedure I followed to install Win 11:

  1. I installed Windows 11 Home (version 21H2, OS build 22000.348) on my early 2011 MacbookPro8,1 having High Sierra. First I converted the drive to GPT/MBR hybrid format by following the steps given under 'Method 2' in the answer to the question at How to convert a drive from the GPT format to the hybrid GPT/MBR format when using High Sierra (macOS 10.13.2).
  2. Then, I followed the steps given in the answer to the question at How to install Windows 10 into a 2011 iMac without using the Boot Camp Assistant, an optical (DVD) drive or third party tools? to install Win 11. I added registry entries to bypass TPM check, RAM check and SecureBootCheck before starting the installation. Win 11 is installed in the partition disk0s4.
  3. I have disabled Boot Camp from windows startup as the BSOD was coming up a short while after the system booted up. If I double click Bootcamp.exe under Program files, I get a BSOD.
  4. I had used the Boot Camp Assistant on my Mac to download the Window Support Software. I clicked on the "Action" pulldown on the Boot Camp Assistant menu bar to download it.
  5. Before starting the whole process, I had partitioned the harddisk into three - one had macOS, a second one for Win 11 and a third one that's empty right now.

I have been working on Win 11 full time for a week now without any other issues. It would be wonderful if the function keys also work as in macOS.

How to make 6000 iPad photos editable

Posted: 28 Nov 2021 07:17 AM PST

History - many years of Apple devices - MacBooks, iPhones, iPads. Result= 8000+ photos viewable on iPad but 6000 of them won't sync with Photo or iMazing. Workaround is for each photo to try to edit then say yes to "Duplicate and Edit" (and then edit a bit so it will save it) but I can't do this with 6000+ - its impractical.

I need a better fix. I want them ALL to be editable and thus seen by iTunes/Photos.

Since I can't see the files with any device but the iPad what can I do ?

This must have happened to others too. The devices/Libraries from which they originally came are no longer in service so going back there is not a solution. I don't want to delete them, just "free them" from association with a device.

Disk Utility deletes my Windows EFI partition

Posted: 28 Nov 2021 12:50 PM PST

I am trying to multiboot Windows, Linux and macOS Catalina all installed on the same drive. I can get it working quite easily if macOS is the first OS on the drive.

However I have problems if my drive partition layout is like this:

  1. Windows EFI
  2. Windows OS
  3. Linux Root
  4. Linux Home
  5. macOS EFI
  6. macOS
  7. exFAT share partition

I read that it is safer to format an exFAT partition from macOS disk Utility if that partition is to be used to share data between macOS and other OSs.

So I repartitioned the "share partition" in macOS disk utility to format it again as exFAT. But when I did this my Windows EFI partition was deleted and I can no longer boot in to Windows or Linux.

I know how to rebuild the Win 10 boot files and Grub bootloader config and I also know what I am doing is not good practice.

I am only asking what is going on such that a simply change to a drive partiton in Disk Utility causes the Windows EFI partition to become deleted? This didn't happen on my other multiboot set up when the macOS EFI partition is the first partition on the drive followed my macOS then Windows EFI/WindowsOS/LinuxOS.

From testing the same thing happens when I use disk utility to clone a macOS installation into a container on a drive that already has Windows on it... the Windows EFI gets nuked.

Cheers,

Flex

How can I delete the files in /System/Volumes/VM?

Posted: 28 Nov 2021 04:36 AM PST

Just as an experiment/exercise, I tried deleting the swap files in /System/Volumes/VM but no matter what I did, it was prevented.

  • sudo rm - operation not permitted
  • sudo xattr - didn't return anything
  • launching Finder as root - some error message

I probably tried a couple of other things too, to no avail.

I don't care if this causes the computer to crash, I am doing it because I curios - so what does it take to delete the swapfiles (besides, they probably won't disappear anyway because they are still kept open by the system and won't go away until that filehandle is released)?

Virtualbox - Kernel driver installed

Posted: 28 Nov 2021 04:16 AM PST

I'm running VirtualBox 6.1. After the upgrade to macOS Monterey, my VM's fail to start up with the error message

Kernel driver not installed (rc=-1908)

I tried reinstalling VirtualBox and, while that worked at the moment, the problem began again when I turned on my computer the next day.

Based on similar questions on this site, I checked System Preferences -> Security & Privacy. However, there's no pending request from Oracle.

Is there an open source alternative to diskutil available for macOS?

Posted: 28 Nov 2021 09:00 AM PST

Is there an open source alternative to diskutil available for macOS? I am hoping to find a command line program that perform the same core functions like:

  • verify disk or volume

  • repair disk or volume

  • mount disk or volume

  • partitioning disk etc.

  • obtain info on a disk

  • obtain activity on a disk

And maybe can perform more functions than the above. And which can be compiled to run on macOS.

Reason for this: I am trying to learn the internals of such disk functions. diskutil is not open source unfortunately. I just need something similar, I do not need support for HFS or APFS if this is a problem. Also, I have tried tracing back to the BSD's diskutil version on which macOS diskutil is based, but I cannot seem to find a way to simply obtain the binary for diskutil and the source code, it seems to be lumped together with the entire kernel's code on (https://cgit.freebsd.org/src/).

I do not have enough experience/knowledge to navigate the source tree.

Any suggestion will be really appreciated.

unzip archive with filenames containing umlaut

Posted: 28 Nov 2021 07:04 AM PST

I got a zip archive containing files some of which with a name containing German umlaute, such as ö. The unzip command on a terminal fails to create such files, complaining about an illegal byte sequence.

How can I fix that issue?

How to include the DOMAIN\ in the name autofilled field when connecting to a Samba share from Finder?

Posted: 28 Nov 2021 04:11 AM PST

I have a samba folder saved on my Finder Favourites. The Account field for the associated server in Keychain includes the domain (so,DOMAIN\USERNAME ) but when I click to connect and the Account and Password are autofilled, the DOMAIN\ isn't included and I have to manually type it in every time. How do I force the DOMAIN\ to be included?

Options to download Garage Band app for macOS unsupported in App Store?

Posted: 28 Nov 2021 04:01 AM PST

Apple dropped support for my Mac Mini Late 2012 to upgrade to BigSur.

With it I can't download GarageBand (I already have iMovie) software compatible with my macOS version Catalina.

"We could not complete your purchase. Garage band can't be installed on because macOS version 11 or later is required."

Apple forums say you can't do it. SOL: I never purchased Garage Band for High Sierra 10.13.6 and now I would like to install it (MAR 2021)

What official (or unofficial) options do I have to download GarageBand for macOS unsupported in App Store?

Getting 5120 X 1440 @ 120Hz on a 2018 Mac mini

Posted: 28 Nov 2021 07:30 AM PST

I recently just purchased a Samsung CRG9, which is a really great monitor. Only problem I have is that I'm not able to get the full 5120 X 1440 at 120Hz that the monitor is rated for. I can get the 5120 X 1440 at 60Hz just fine, but it would be nice to be able to get 120Hz at that resolution as well if possible. I'm using a high-quality DisplayPort 1.4 to Thunderbolt 3 Cable.

Does anyone here know how to do this? Especially if you own this monitor.

Thanks in advance!

Safari reuses already existing tabs instead of opening new ones

Posted: 28 Nov 2021 08:04 AM PST

If I click a link in say an e-mail or application and that exact link already has an open tab, Safari will focus that tab instead of opening it anew at the end of the current window.

I would prefer this behaviour to be different because moving the focus is really distracting and often I want the new tab to open in the current window/context.

Is there a way to change this?

Toggle between two most recent windows of the same app in Mac

Posted: 28 Nov 2021 06:08 AM PST

We know that using Command + ` (Cmd + backtick) will allow you to switch between windows of the same app. Suppose I have 5 windows of Chrome and I want to toggle between two most recent windows of Chrome. Is there a shortcut for that? Can we assign one?

Does iOS allow any app to look at the clipboard data?

Posted: 28 Nov 2021 03:51 AM PST

As far as I know, there should be a way so that the clipboard data is only provided to the app when it is user initiated. My question is: does iOS actually allow any app to look at the clipboard's data even when it is not user initiated. Is it a fact, or is it not?

Option for Second Alert on Calendar Events Disappeared After Mojave 10.14.6 Update

Posted: 28 Nov 2021 05:02 AM PST

I just updated my Macbook Pro to Mojave 10.14.6 and noticed that I can no longer set a second alert on events I add to my Calendar. I'm not using any external calendars or accounts, just my iCloud. I can still set second alerts on my iPhone, just not my computer.

How to change language of an existing Pages for iCloud document?

Posted: 28 Nov 2021 01:04 PM PST

I have document that was created in Pages for Mac with the correct spelling/language (not English) settings for each paragraph. However, when I now try to edit this document using Pages for iCloud the spelling is set to English.

I have read several support documents about this

Pages for iCloud: Work in other languages

Pages for iCloud: Search, replace, and spell-check text

iCloud: Change the language or time zone on iCloud.com

as well as some "third party" suggestions, all to no avail.

I have made sure that the correct language is my primary language in my browser (Chrome), in my OS (Win 10), changed the language of the iCloud UI (through Settings), changed the format used by iCloud (also via Settings) but my document is still spelled in English.

I believe the first link above explains how one create a completely new document in a certain language but my document already exists.

How do I change the language used for spell-check on an existing document?

After installing wine with a .pkg, I get the error wine: command not found when running from the terminal but the app works fine

Posted: 28 Nov 2021 05:36 AM PST

I have installed wine through a .pkg from here. Wine Stable.app works fine, but when I run any wine-related command from the terminal, I get command not found.

macOS Terminal command to test Internet speed

Posted: 28 Nov 2021 05:01 AM PST

Anyone know what command can I use to check my Internet speed in the Terminal app?

May be I can use curl command and add some IP addresses, like the to check our IP and Country location via curl ipinfo.io command?

My keyboard stopped repeating - how to fix?

Posted: 28 Nov 2021 03:46 AM PST

I have both an internal and external keyboard but the key-repeat has stopped working. I've tried changing both 'Key Repeat' and 'Delay Until Repeat' as shown below but no setting seems to be helping.

enter image description here

This is a brand new mac (5 weeks old).

Recent Questions - English Language & Usage Stack Exchange

Posted: 28 Nov 2021 01:21 PM PST

Recent Questions - English Language & Usage Stack Exchange


What's the meaning of genre conventions?

Posted: 28 Nov 2021 11:24 AM PST

Could you please tell me the meaning of "genre conventions" in the following sentence?

As this brief overview has shown, from the level of terms, to phraseology, register, genre conventions and communicate functions, the translators who work with specialized texts...

Is "to calm down someone" acceptable?

Posted: 28 Nov 2021 09:41 AM PST

I just came across an ESL student writing "to calm down your followers". I much prefer "to calm your followers down". Does anyone agree? If so, why? "Calm down" is generally considered a phrasal verb, but if my reaction is shared by others, then here "calm", in its transitive sense, is behaving more like a simple verb plus locational adverb, in which case the object "followers" naturally comes before the adverb--*"I sent to New York the package." Compare "I sent home X", which sounds a bit better with some direct objects than others; "I sent home the students" will pass, in my book, though most other objects don't. I don't like "I sent home Jerome" as much as "I sent Jerome home", though this may be more a matter of good style than grammar. Note finally that the best opposite to "calm down" I can think of is "stir up", but this seems to behave like a conventional phrasal verb; for my part I have no objection to "to stir up your followers." Again, does anyone agree? Why or why not?

Plural when referring to an attribute shared by members of a group

Posted: 28 Nov 2021 09:08 AM PST

Assume that you own a collection of chairs. Each chair is made by a different maker and bears the mark of its maker. Moreover, each chair has only one maker and thus only one mark.

Now consider the following sentence:

  • All the chairs had their makers' marks.

My question is: does the above sentence accurately describe the situation? Specifically, I am unsure whether the use of the plural in "marks" is correct. Does it entail that the chairs had more than one mark, or not?

I am aware that there might be clearer ways to describe the situation above (namely: "each chair had the mark of its maker," or similar forms). Still, I am concerned with the above sentence specifically.

Many thanks in advance for the help.

Somehow a synonym for competition

Posted: 28 Nov 2021 09:27 AM PST

I'm writing an English essay about our favourite singer or band.

I want to write something like

They have won many awards at different competitions.

but I know competition is not the right word. What should I use? I don't think "place" or "shows" is right either.

"All green apples but 1" or "All but 1 green apples"

Posted: 28 Nov 2021 08:49 AM PST

I would like to use phrase "all but one" in the sentence like "Except for the one green apple, all the other green apples are bad."

Which expression is not ambiguous? "All but one green apples are bad." or "All green apples but one are bad."

Does "All but one green apples are bad." means "All apples but one green apple are bad." or "All green apples but one green apple are bad"?

Variant of English pronunciation in the UK

Posted: 28 Nov 2021 11:31 AM PST

On YouTube, I noticed a channel "RateMyTakeaway" with a man with interesting pronunciation

here is an example: youtube video

on 1:26 he says (as I can understand):

"no thank, you love, I'm sweet enough" or "no thank a lot, I'm sweet enough"

he pronounces "love" or "lot" as /lov/ and "enough" as /ɪˈnof/

and basically whole his speech is a little bit weird and in some way musical.

Can some tell me how today linguists describe it? Or it's just normal English and I do not have enough experience of real English in the UK?

Phrases or idioms which mean "I did not do my homework"

Posted: 28 Nov 2021 07:36 AM PST

İs there any idom or phrase to say you did not prepare your homework?

For example, my teacher gives me homework. Let's assume that I did not do my homework, what should I say?

"Flows through" vs "Flows in"

Posted: 28 Nov 2021 06:48 AM PST

I got this question:

River Mahanadi flows _______ Odisha.

Will it be "in or "through"? Had it been a smaller place, like a forest, or a city, I would've chosen "through"; but since the place is Odisha, which is an entire state in India, can "in" be suitable too? Implying that the river exists in the state Odisha.

when using expressions like "right wing populism", can we use the preposition 'in' before it? [duplicate]

Posted: 28 Nov 2021 04:23 AM PST

The 21st century saw the steady rise of right-wing populism, anti-elitism, and neo-nationalism and social conservatism.

What I wish to say is that these trends emerged much earlier, but have intensified in the last few decades. Should I use rise in right-wing populism or rise of in this case? regards.

I pronounce initial R's with my upper teeth on the very bottom of my inside lower lip. Not rhotic. What's the IPA for this?

Posted: 28 Nov 2021 11:13 AM PST

The Wikipedia page (https://en.wikipedia.org/wiki/Pronunciation_of_English_/r/) doesn't mention an option for pronouncing R where the upper teeth are really, really at the bottom of the inside lower lip, practically touching the gums by moving the lower lip up over the upper teeth. Not rhotic.

The rear part of a church [closed]

Posted: 28 Nov 2021 03:13 AM PST

What is the difference between sanctuary, chancel and presbytery?

Water froze: The water or the frozen water? [closed]

Posted: 28 Nov 2021 03:11 AM PST

I said, "Water froze." Then, what did I refer to? I have to add 'the.'

  1. The water
  2. The frozen water
  3. The water & The frozen water

Why is it not an English question? In my native language, there's not only no article, but also the concept of referring back to something is vague.

Difference among sound, music and audio

Posted: 28 Nov 2021 03:20 AM PST

From Differences between "audio" and "sound"?, I learned that sound is a generic term and can be caused by any source.

Audio refers to sound coming from a recording, transmission or electronic device.

However, what's the difference between audio and music? I googled this and found answers all over the place.

I'd appreciate any guidance.

What can I call 2nd and 3rd place finishes in a competition?

Posted: 28 Nov 2021 04:57 AM PST

There are many awards I received from the sport I did. I thought to compress everything and write as 'Inter university and All island winner' but I have placed only 2nd and 3rd places. What is the best way to correct this?

What is the origin of the British phrase "Rough as houses"?

Posted: 28 Nov 2021 12:53 PM PST

I'm preempting the usual comments by saying: If you're not British, you probably won't have heard it before.

But it is a fairly well known phrase in BrE.

For instance, in this book:

Unfortunately, it meant that we were without Yos and Ga for the game and myself, Jer, Jumpy, Sherry, Reg, Pob, were all feeling distinctly rough as houses.

Pretty much the last thing you want to do with a stinking hangover is go out on a Sunday morning, put shorts on and attempt to run around in the pouring and freezing rain.

emphasis added

Which matches my understanding of it meaning "feeling very unwell".

Even though nGrams finds nothing, I'm confident it's not a new phrase.

The answer bank has some speculative guesses (derived from "roughhousing" or "rough as a bag/arsehole"), but I'm looking for an actual etymology and/or origin.

What is the origin of the British phrase "Rough as houses" ?

English words ending with -enk/-eng

Posted: 28 Nov 2021 07:09 AM PST

Why aren't words ending with -enk/-eng more common in modern English?

How to say "you added a clause in end of statment"? [closed]

Posted: 28 Nov 2021 06:11 AM PST

How do you call the act of adding a clasue to the end of a statment, which weakens it and makes it sort-of conditional?

Examples: "Nice to see you, this time!"

"I love it, in a way,

"It's not the case, yet" ("There are no zombies in the world, yet")

"There are no zombies in the world, for now"

"I really enjoyed it, this time."

"It costs only two dollars, more or less"

"She is cute, when she's well fed"

"It is funny, if it's true"

The clasue makes the above statements read somewhat ironically. The clasue somehow takes the statement back a bit, instead of making it conclusive. To refer to this act, I want to say: "You phrased your statement with a (?????) in the end." Any idea?

Is it called a "qualifier"? Or otherwise, what?

Correct grammatical number of items belonging to a group, e.g.. ‘Every person has a nose.’

Posted: 28 Nov 2021 07:09 AM PST

In the sentence 'Every person has a nose.' there are many persons, but the plural of nose is not used.

I'm really curious that 'a nose' itself refers to all noses or itself just refers to a nose?

Another example: "Every dog has a tail, it/they is/are long" which is correct?

"the ride never ends"

Posted: 28 Nov 2021 05:09 AM PST

Having a hard time understanding an idiom a person used on an anonymous bbs.

Remember, the ride never ends.

What could he have meant by this? I'm aware that it's a reference to an old video game meme or something, but it's still very confusing.

enter image description here

why motor uses more amps

Posted: 28 Nov 2021 12:37 PM PST

Why does a motor utilize more amps when encountering resistance?

"the difficulty is we need..." or "the difficulty is that we need..."

Posted: 28 Nov 2021 01:06 PM PST

Is there a right or wrong answer in the following construction? Am I missing a more elegant way to say this?

"The main difficulty in the hiring process is we need a fluent French speaker that also knows Mandarin"

or

"The main difficulty in the hiring process is that we need a fluent French speaker that also knows Mandarin"

I can see how the "is that" seems more fluid at first, but I don't like slinging so much "is that" stuff around in my writing; and if you speak this with the right cadence, "is" works just fine.

If "in the hiring process" is removed (or moved to the beginning of the sentence), "is" seems to be the clear winner to my ear.

(Don't ask why I want to know. Let's just say I now understand why many writers don't like editors.)

Popular phrases for upselling

Posted: 28 Nov 2021 09:03 AM PST

Is there any popular phrase (proverb/idiom/slang) describing someone ended up buying something much more expensive than what's originally needed? Somewhat like, need a bike, paid for a Mercedes. Ideally, whether the person succumbs to sales pitch or to his/her own greed isn't the point the phrase alludes to.

You have the watches, but we have the time

Posted: 28 Nov 2021 09:56 AM PST

This quote is associated with the Taliban in reference to the US occupation of Afghanistan.

I understand the metaphorical meaning of the quote — i.e. the point that it makes.

But I am intrigued by the literal meaning. In particular, I can't work out what it means to "have the watch", nor what the "watch" refers to metaphorically.

Anybody know?

For the record, I've done some searches, but have only turned up explanations of the metaphoric meaning, nothing about analysis of the literal meaning.

When is it necessary or preferable to use 'in the' before a time period?

Posted: 28 Nov 2021 01:07 PM PST

When is it necessary or preferable to use 'in the' before a time period? Is one sentence more formal? Does the length of time matter?

Example 1: He was born last century. Example 1a: He was born in the last century.

Example 2: He was born last week. Example 2b: He was born in the last week.

Example 3: His birth was last century. Example 3a: His birth was in the last century.

Example 4: He was born middle of the night. Example 4a: He was born in the middle of the night.

To me, examples 1 and 3 sound better with 'in the', but I don't know why.

"a past that we have forgotten about" and "a lot of pasts"

Posted: 28 Nov 2021 11:02 AM PST

I'd appreciate it if someone would answer my question. Thank you.

A: Everybody has a past and everybody has a future.

B: And the fallacy comes from idealizing a past that we have forgotten about. (from google)

C: The present moment is made of a lot of pasts. (from google)

I think "a past" in A is a personal past experience, and it's rightly used.

But how about "a past that we have forgotten about" in B and "a lot of pasts" in C?

I've heard such words as "a past that should never have existed" and "a past that has never been present".

Can you really use "a past" meaning a past time related to the whole universe, not an individual person?

Another verb for "speaks to"

Posted: 28 Nov 2021 07:28 AM PST

I often hear the phrase 'speak to' used as a verb. For example, "This event speaks to the need for good communication" or "Samantha, can you please speak to these dot points?"

It seems appropriate for a casual or colloquial scenario. The term 'address' can also be used but I feel this often implies the original material was a problem or issue. Whereas, 'Speaks to' can be used to offer a reflection or explanation of the original material.

Is there a more formal or professional verb that could also be used in this instance?

"A friend to all is a friend to none" - Aristotle. What does this exactly mean?

Posted: 28 Nov 2021 06:39 AM PST

Why shouldn't a person be friendly to everyone? Is "being friendly" and "being a friend" being differentiated here?

Also, I consider a person as one's friend only if that person doesn't betray his/her other friends. So going by my rule of friendship, there won't be any problem if my friend is a friend to every person, since he/she is not going to give up on me and neither he/she will give up on his/her other friends when he/she us spending his time with me.

What is the main context under which this proverb becomes true?

What is the difference between a Cathedral and a Minster? [closed]

Posted: 28 Nov 2021 04:56 AM PST

In the UK we have a lot of Cathedrals. We also have York Minster but I'm unsure what is special about York that makes it a Minster rather than another Cathedral.

The only other case I can think of is Westminster Abbey although I believe this is named after the City of Westminster.

What does a religious building require to be classed as a Minster rather than a Cathedral?

Punctuation around the word "namely"

Posted: 28 Nov 2021 10:06 AM PST

It seems somehow tricky to apply the right punctuation when it comes to the word namely. I got the following advice:

Search globally for "namely", and add a comma after it, as well as a comma, a semicolon, or a period before.

On the other hand, this link and this one suggest that there might be more to consider. So, what are the rules for punctuating around the word namely? Please try to prove your claims by including references.

OSCHINA 社区最新专区文章

Posted: 28 Nov 2021 12:23 PM PST

OSCHINA 社区最新专区文章


binder流程大概流程过程

Posted: 27 Nov 2021 11:36 PM PST

1,service_manager.c启动的时候,会调用一个无限循环binder_loop方法,在这个方法中有个ioctl方法,这个方法应该是阻塞方法吧 他是不是不停的监听,客户端连接和服务端注册的任务? 2,当一个服务启动后,首先往binder进行服务注册,他注册的时候,也会ioctl后,然后被binder驱动指向目标端 service_manager 进程 接着 ...

OSCHINA 社区最新新闻

Posted: 28 Nov 2021 11:59 AM PST

OSCHINA 社区最新新闻


Godot 4.0 将支持多人游戏场景复制

Posted: 28 Nov 2021 10:34 AM PST

除了 Vulkan 支持和大量图形渲染器工作之外,Godot 4.0 还改进了其多人游戏开发功能。 多人游戏一直是一中复杂的功能,需要临时优化和特定于游戏的解决方案,并主要包含两个概念:某种形式的消息传递和某种形式的状态复制(同步和协调)。虽然 Godot 此前提供了一个消息传递系统(即 RPC),但它没有提供一个通用的复制系...

Linux 5.17 将为 AF_UNIX 套接字提供延迟优化

Posted: 28 Nov 2021 10:15 AM PST

提交记录显示,Linux 5.17 将为 AF_UNIX 套接字提供延迟优化。 Linux 5.17 合并窗口即将开始,Net-next 分支中已经堆积了许多优化,包括一个大的 TCP 优化和一个用于网络代码中校验和计算的 csum_partial() 的改进。最新的优化是为那些使用 AF_UNIX 套接字进行本地进程间通信的人改进 AF_UNIX 代码路径。 该系列补丁由日...

建木持续集成平台 v2.0.0 发布

Posted: 28 Nov 2021 05:04 AM PST

建木持续集成平台是基于建木自动化平台提供的国产开源CI/CD产品,致力于为国内开发者提供简单易用、方便快捷的开发体验,推广DevOps的最佳实践,填补国内开源软件供应链中缺失的一环。 建木持续集成平台v2.0.0现已发布 主要更新:重构核心概念及修复若干已知bug rfc: 事件桥接器重构为触发器,引入trigger dsl,在项目d...

GitHub 宕机超 2 个小时

Posted: 27 Nov 2021 05:12 PM PST

根据外媒的报道,GitHub 今天经历了长达两个多小时的宕机,影响了数以千计甚至数百万依赖其众多服务的开发者。报道称,GitHub 在美国东部时间下午 3:45 左右开始出现问题,包括 Git 操作、API 请求、GitHub Actions、GitHub Packages、GitHub Pages 和拉取请求等服务都受到影响。 当时 GitHub status 页面写道:"我们正...

AMD 开源驱动让《我的世界》性能提升 30%

Posted: 27 Nov 2021 04:54 PM PST

在 Linux 上使用开源的 AMD Radeon OpenGL 驱动 "RadeonSI" 的用户,现在在游玩《我的世界》(Minecraft)时,性能将提升 30%。 Marek Olšák 是知名的 GPU 驱动开发者,目前就职于 AMD,他也是近些年来最活跃的 Mesa 开发者之一。他现在是 Mesa 历史上第二大贡献者 —— 仅次于 Mesa 的原作者 Brian Paul。 RadeonSI 驱...

英特尔准备为 Linux 提供 USI Stylus 支持

Posted: 27 Nov 2021 04:00 PM PST

提交记录显示,英特尔工程师提交了一份为 Linux 内核的 HID 子系统添加 USI 手写笔支持的征求意见补丁。 英特尔的开源驱动工程师一直致力于为 Linux 内核提供 USI 手写笔支持。通用手写笔计划 (USI) 旨在提供跨触摸屏设备的有源手写笔的互操作性,其目标是允许所有符合 USI 的手写笔跨设备工作。目前,USI 得到了谷歌等公...

NVIDIA Image Scaling SDK 1.0 发布

Posted: 27 Nov 2021 03:32 PM PST

上周,NVIDIA 将其开发的 Image Scaling 技术开源,NVIDIA Image Scaling(NIS)是一个跨平台、跨 GPU 的图像缩放实现。当时,英伟达还将 NIS 的 SDK 一同发布至 GitHub 平台,如今 NIS 的 SDK 正式发布 1.0 版本。 NIS 的 SDK 可以通过 SDK 上的通用计算着色器在英特尔和 AMD Radeon 等硬件上使用。该 SDK 提供了一种跨...

IPython 7.30 发布,为 8.0 版本做好准备

Posted: 27 Nov 2021 03:15 PM PST

IPython 是一个综合环境,可以帮助程序员或开发人员等高级计算机用户测试或探索各种功能。尽管 Python 附带了一个强大的交互式解释器,使用户无需在目标计算机上创建额外的文件即可运行测试,但它在用户与软件交互方面存在一些限制。 IPython 的三个核心部分包括一个高度交互式的 Python shell,一个解耦的双进程通信模型...

每日一博 | 淘特 Flutter 流式场景的深度优化

Posted: 27 Nov 2021 03:13 PM PST

淘特在很多业务场景都使用了 Flutter,加上业务场景本身具有一定的复杂性,使得 Flutter 在低端机流式场景的滑动浏览过程中卡顿、跳帧对比使用原生(Android/iOS)开发明显。

Gitee 推荐 | 基于 DevUI Design 设计体系的 Vue3 组件库

Posted: 27 Nov 2021 03:10 PM PST

vue-devui: 一个基于 DevUI Design 设计体系的 Vue3 组件库,使用最新的 Vite + Vue3 + TypeScript + JSX 搭建,包含60多个简洁、易用、灵活的组件。 (gitee.com)

LibreWolf —— 开源的 Firefox Fork 浏览器

Posted: 27 Nov 2021 03:08 PM PST

LibreWolf 是 Firefox 的一个分支,它通过删除遥测和添加其他功能来关注用户隐私和安全。支持 Windows、macOS、Linux。

PMD 6.41.0 发布,引入 GNU 样式长选项

Posted: 27 Nov 2021 03:05 PM PST

PMD 是一个代码分析器,能够帮助发现常见的编程问题,比如未使用的变量、空的 catch 块、不必要的对象创建等等。最初仅支持 Java 代码,目前还可支持 JavaScript、Salesforce.com Apex 和 Visualforce、PLSQL、Apache Velocity、XML 和 XSL 。 PMD 6.41.0 正式发布,本次更新内容如下: GitHub Action for PMD PMD 现在有...

Recent Questions - Mathematics Stack Exchange

Posted: 28 Nov 2021 11:59 AM PST

Recent Questions - Mathematics Stack Exchange


mathematical induction, where to start with this problem..

Posted: 28 Nov 2021 11:55 AM PST

I'm unsure where to begin answering this question, what would be the base case when applying induction on n? P(1) = ?

Prove: If there exists an injection Nm→Nn then m≤n

Consequences of the Globalization Theorem in Hirsch's Differential Topology

Posted: 28 Nov 2021 11:54 AM PST

In Hirsch's book, there is a wonderful theorem 2.11:

enter image description here

where a structure functor is simply a presheaf, and continuous means it is a sheaf (it has the gluing property). Nontrivial means there is at least one local section.

Locally extendable means, in his words:

enter image description here

As an example, if $X$ is a $C^r$ manifold, and if $\mathfrak{F}(Y), Y\subseteq X$ is the set of compatible $C^s$ differential structures on $Y$, $1\leq r <s \leq \infty$, then $(\mathfrak{F}, \mathfrak{U})$ ($\mathfrak{U}$ the open sets of $X$) form a nontrivial, continuous, locally extendable structure functor.

My question is: how can we use this technique to the problem of Finding a Retraction for a Collar Neighborhood? I copy the relevant excerpt:

enter image description here

Why for x ∈ Z if (a, b) > (0,0) then a > b

Posted: 28 Nov 2021 11:54 AM PST

thanks for your time

I have been studying the axiomatic construction of the integers set using a text book, and in one of their proofs they use that conclusion as an starting point to a demonstration, but they did not tell why they can assume that for x ∈ Z if (a, b) > (0,0) then a > b.

By the way, I get that if x=(a,b)<(0,0) then −x=(a,b)>(0,0)

References for minimizers of energy in metric spaces

Posted: 28 Nov 2021 11:52 AM PST

As the title suggests, do you know some literature, books, articles or notes, that treats the connection between geodesic in a metric space and the energy associated to the curves? In particular, I am interested in some sort of $p$-energy, like the integral of the $p$-th power of the metric derivative of a curve, or something like that, and also to the relation to the ones that minimize the legth. Is there any source that treats this particular case, if they exist?

I am confused at a step in the proof of Cauchy Criterion otherwise known as Cauchy Condensation

Posted: 28 Nov 2021 11:51 AM PST

Lemma 7.3.6 For any natural number $K$, we have $S_{2^{K+1}-1} \leq T_K \leq 2S_{2^K}$

Where $S_N := \displaystyle \sum_{n=1}^{N} a_n$ and $T_K := \displaystyle \sum_{k=0}^{K} 2^ka_{2^k}$

in this proof he uses induction, I'm confused at this part:

$S_{2^{K+1}} = S_{2^K} + \displaystyle \sum_{n=2^K+1}^{2^{K+1}} a_n \geq S_{2^K} + \displaystyle \sum_{n=2^K+1}^{2^{K+1}} a_{2^{K+1}} = S_{2^K} + 2^Ka_{2^{K+1}}$

im confused how does $\sum_{n=2^K+1}^{2^{K+1}} a_{2^{K+1}} = 2^Ka_{2^{K+1}}$?

in fact how does this notation $\sum_{n=2^K+1}^{2^{K+1}} a_{2^{K+1}}$ even make sense?

Upper bound of $(1+x)^n$ and lower bound of $(1-x)^n$

Posted: 28 Nov 2021 11:49 AM PST

Is there any generic lower bound of $(1-x)^n$ and upper bound of $(1+x)^n$, where $0<x<1$ and $n\in\mathbb{N}$?

Series expansion of $\frac{1}{\log^{\alpha}\left(1+\frac{1}{s}\right)}$?

Posted: 28 Nov 2021 11:49 AM PST

The series expansion of $\log(1+x)$ around zero: $${\displaystyle\log(1+x)=\sum _{n=1}^{\infty }(-1)^{n+1}{\frac {x^{n}}{n}}}, \quad\text{valid for}\,\, -1<x\le 1.$$ I'm trying to get the series expansion of: $$f(s)=\frac{1}{\log^{\alpha}\left(1+\frac{1}{s}\right)}=\log^{-\alpha}\left(1+\frac{1}{s}\right),$$ where $s>0$ and $0<\alpha<1$.

Definition of ZFC2 (second order logic)

Posted: 28 Nov 2021 11:45 AM PST

ZFC with 1st order logic is known.

My question may be formulated either way

  • What is the definition of ZFC2 (ZFC+second order logic)? (I assume that formulas also have quantifications of two kind over object and over predicates. Then what are some examples of statements in ZFC2 that cannot be proved in ZFC1?)
  • What are the sources with precise definitions of second-order logic?
  • Are there exist a "standard" deductive system of second-order logic? (what exactly reasearchers mean talking about second order logic)
  • What are the reasons to use the second order logic while one may have a type theory?

Question is motivated by https://mathoverflow.net/questions/409521/does-there-always-exist-a-categorical-extension-of-zfc-2-with-no-set-models and What's a good introduction to Second Order Logic (has no accepted answer)

unity roots of complex number

Posted: 28 Nov 2021 11:54 AM PST

for any complex number z which in the unit circle but not a unity root how to prove that there is a sequence of unity roots that converges to z? I know that unity root is $ e^{i\theta}$ when $\theta$ is $2\pi*$$\frac kn $

Do the inference rules of the implication-free fragment of classical logic without disjunction elimination form a complete Hilbert calculus for LP?

Posted: 28 Nov 2021 11:48 AM PST

If I take the inference rules for the implication-free fragment of classical logic (listed below) and drop the pair of rules for disjunction elimination, do I get a complete Hilbert calculus for LP (Logic of Paradox)?

One thing that I am uncertain about, though, is whether pruning away disjunction elimination without adding back a weaker rule in its place actually gives me LP instead of some other system.

I also have a higher-level motivation for this question. I like trying to come up with semantics for various propositional logics, but I'm not good at proving or disproving the completeness of a given semantics. I'm trying to pick a simple example of a nonclassical logic so I can get a feel for how to build a completeness argument.


What follows is an explanation of the question in detail and my attempt to solve the problem myself.


I will assume classical logic and ordinary mathematics in the background for the purposes of this question.

Let's define the logic of paradox using the following truth table.

and          not      F U T  -------      -----  F F F F     F T  U F U U     U U  T F U T     T F  

And let disjunction be defined as follows $a \lor b$ = $\lnot(\lnot a \land \lnot b)$.

Logic of paradox has the following sound and complete semantics. This semantics is transparently based on the semantics of Belnap's four-valued logic.

$F$ is $\{0\}$.
$T$ is $\{1\}$.
$U$ is $\{0, 1\}$.

The designated truth values are $T$ and $U$.

We can defined the semantics of the primitive operations as follows. Let $\oplus$ be xor or equivalently addition modulo 2. Let $\triangle$ be the symmetric difference. These operations are really defined in $2^{\{0, 1\}}$, but they both preserve set non-emptiness.

$[\lnot x] = \{ 1 \oplus n : n \in [x] \}$
$[x \land y] = ([x] \triangle \{1\} \cap [y] \triangle \{1\}) \triangle \{1\} $

Logic of paradox, given the signature $\land, \lor, \lnot$ has the following inference rules (which are also valid in classical logic).

$$ \frac{A}{A \lor B} \;\; \text{is disjunction introduction} $$ $$ \frac{A \land B}{A} \;\; \text{and} \;\; \frac{A \land B}{B} \;\; \text{are conjunction elimination} $$ $$ \frac{A \; \text{and} \; B}{A \land B} \;\; \text{is conjunction introduction} $$ $$ \frac{A}{\lnot\lnot A} \;\; \text{is double negation introduction} $$ $$ \frac{\lnot\lnot A}{A} \;\; \text{is double negation elimination} $$

For my axioms, I will take the following axiom schema (which I nonstandardly call the axiom schema of tautological horn clauses).

$$ \lnot x_1 \lor \lnot x_2 \lor \cdots \lor \lnot x_n \lor \cdots \lor A \;\; \text{where $A$ is in $\{x_1, x_2, \cdots, x_n \}$} $$

The classically-valid pair of rules $\frac{A \lor B \; \text{and}\; \lnot A}{B}$ and $\frac{A \lor B \;\text{and}\; \lnot B}{A}$ is not valid in LP..

I'm pretty sure that the collection of rules above with the disjunction-elimination pair of rules forms a Hilbert calculus for classical logic. The rules are certainly sound with respect to classical logic. I'm pretty sure that these inference rules also guarantee that all the connectives are truth-functional, which gives us classical logic because our background logic is classical logic.

I'm less confident that the rules above without disjunction elimination are complete with respect to the intended semantics of LP.

One property that LP has is that all the connectives are $U$-preserving, so if both arguments are $U$, the result will be $U$ as well. Intuitively, this is the thing that knocks out disjunction elimination. Knowing that the negation of a proposition is true in LP is simply not as informative as it would be in classical logic.

One thing that I am uncertain about, though, is whether pruning away disjunction elimination without adding back a weaker rule in its place actually gives me LP instead of some other system.

Why this function can't be used in fourier expansion?

Posted: 28 Nov 2021 11:40 AM PST

$$y = arccos(sin(2x))$$

I can't see why it can't be used in fourier expansion series. It seems to me that it satisfies all the Dirichlet properties:

Periodic ? Yes, $\pi $.

Continuous ? Yes

Finite number of max/mín in a period? Yes, there is one maximum and zero mínimum.

Module of the integral converges? Yes,$\frac{\pi^2}{2}$

So, what is the problem with the function? Why can't it be used for fourier expansion?

How do I compute this integral with the gauss formula and in direct way?

Posted: 28 Nov 2021 11:51 AM PST

I have the following problem:

Compute the integral $$\int_{\partial A} \langle (x,y^2,z^3),\nu\rangle dS$$ for $A=\{(x,y,z):-1\leq x,y,z\leq 1\}$ in two different ways.

I first wanted to compute it directly, before using the gauss formula, and I did the following computations enter image description here

But somehow I have a problem since my is wrong, I don't integrate over z at all in the first one. But I don't see my mistake.

Could someone take a look?

Thank you a lot.

Inequality involving log in the numerator and linear expressions in the denominator of fractions

Posted: 28 Nov 2021 11:52 AM PST

If $a$, $b$ and $c$ are real numbers in the interval $(0, 1)$, find the minimum value of $$\frac{\log_{a} b}{a-b+1}+\frac{\log_{b} c}{b-c+2}+\frac{\log_{c} a}{c-a+3}$$

I used AM-GM-HM inequality as follows:

$$\frac13 \left( \frac{\log_{a} b}{a-b+1}+\frac{\log_{b} c}{b-c+2}+\frac{\log_{c} a}{c-a+3} \right) \ge \sqrt[3]{\frac{1}{(a-b+1)(b-c+2)(c-a+3)}} \ge \frac{3}{a-b+1+b-c+2+c-a+3}=\frac12$$

Thus

$$\frac{\log_{a} b}{a-b+1}+\frac{\log_{b} c}{b-c+2}+\frac{\log_{c} a}{c-a+3} \ge \frac32$$

Is this even possible? Because I couldn't solve for the equality condition, which is

$$\frac{\log_{a} b}{a-b+1}=\frac{\log_{b} c}{b-c+2}=\frac{\log_{c} a}{c-a+3}$$

Is there another way to see that the given expression indeed can take $3/2$?

Let $f(x)\in\mathbb{F}_q[x]$. Show that if $\alpha$ is a root of $f(x)$ then $\alpha^q$ is a root of $f(x)$.

Posted: 28 Nov 2021 11:42 AM PST

Question: Let $f(x)\in\mathbb{F}_q[x]$, where $f$ is a polynomial and $\mathbb{F}_q$ is a finite field of $q$ elements. Show that if $\alpha$ is a root of $f(x)$ then $\alpha^q$ is a root of $f(x)$.

Thoughts: I know that the characteristic of a finite field is prime. So, we may write $q=p^n$ for some prime $p$ and $n\in\mathbb{N}$. I would like to show that when we take $f(\alpha^q)$, the polynomial $x^q-x=0$ splits over $\mathbb{F}_q$ (I think this would show what we want...?) So, we may write $f(x)=a_0+\dots +a_nx^n$ for $a_i\in F$. Then, since $\alpha$ is a root of $f$, we have that $f(\alpha)=a_0+\dots +a_n\alpha^n=0$. So, $f(\alpha^q)=(a_0+\dots +a_n\alpha^n)^q=a_0^q+\dots +a_n^q\alpha^{nq}$. But, now I'm stuck. Could I just say that $a_i^q$ are still just elements of $\mathbb{F}_q$, so I can write this as $a_0+\dots +a_n\alpha^{nq}$... but I don't think this gets me anywhere. Any help would be greatly appreciated! Thank you.

Solving $|1 - \ln(1 - |2x| + x)| = |1 - |3x||$

Posted: 28 Nov 2021 11:45 AM PST

I am asking you for help (that is, just verify my passages and perhaps to right my wrongs) about this exercise.

$$|1 - \ln(1 - |2x| + x)| = |1 - |3x||$$

Now here is what I have done. First of all I have to analyse the lefthand term, so starting from the inner part:

$$1 - |2x| + x = \begin{cases} 1+3x\ \ \text{for}\ \ x < 0 \\\\ 1-x\ \ \text{for}\ \ x > 0 \end{cases}$$

This being said and it's now the existence for the logarithm's turn:

$$\begin{cases} 1+3x > 0 \ \ \text{for}\ \ x > -1/3 \\\\ 1-x >0 \ \ \text{for}\ \ x < 1\end{cases}$$

Whence eventually, intersecting the solutions:

$$\ln(1 - |2x| + x) = \begin{cases} \ln(1+3x)\ \ \text{for}\ \ -1/3 < x \leq 0 \\\\ \ln(1-x)\ \ \text{for}\ \ 0\leq x < 1 \end{cases}$$

Going on, it's about the external absolute value. I thence split into two:

$$|1 - \ln(1+3x)| = \begin{cases} 1 - \ln(1+3x) \ \ \text{for} x < \frac{e-1}{3} \\\\ -1 + \ln(1+3x)\ \ \text{for}\ \ x>\frac{e-1}{3}\end{cases}$$

Yet here the second possibility NEVER happens for we had $0\leq x < 1$ where as the first one is less restrictive than what we had ($-1/3 < x \leq 0$) so we neglect it.

For the second piece:

$$|1 - \ln(1-x)| = \begin{cases} 1 - \ln(1-x)\ \ \text{for}x > 1-e \\\\ -1 + \ln(1-x)\ \ \text{for} \ \ x < 1-e\end{cases}$$

Again the second one never happens, and the first one implies a new restriction. Eventually:

$$|1 - \ln(1 - |2x|+x)| = \begin{cases} 1 - \ln(1+3x)\ \ \text{for} -1/3 < x \leq 0 \\\\ 1 - \ln(1-x) \ \ \text{for}\ \ 1-e \leq x < 1\end{cases}$$

Is this correct so far??

Clearly the second part is easier (I hope), getting in the end

$$1 - |3x| = \begin{cases} 1+3x\ \ \text{for}\ \ x<0 \\\\ 1-3x \ \ \text{for}\ \ x> 0\end{cases}$$

Which splits the external absolute values into two pieces again:

$$|1 + 3x| = \begin{cases} 1+3x\ \ \text{for}\ \ x>-1/3 \\\\ -1+3x \ \ \text{for}\ \ x< -1/3\end{cases}$$

and

$$|1 - 3x| = \begin{cases} 1-3x\ \ \text{for}\ \ x>-1/3 \\\\ -1+3x \ \ \text{for}\ \ x> 1/3\end{cases}$$

Then I guess it's all to unify, and what remains is:

$$|1 - |3x|| = \begin{cases} 1+3x\ \ \text{for}\ \ -1/3 <x<0 \\\\ 1-3x \ \ \text{for}\ \ 0<x< 1/3 \\\\ -1+3x\ \ \text{for}\ \ x>1/3 \cup x<-1/3\end{cases}$$

To get the final equations, I split the interval of the logarithm as follows:

$$1-e<x<1 = 1-e<x<-1/3 \cup -1/3<x<0 \cup 0<x<1/3 \cup 1/3<x<1$$

So the final equation reduces to the following equations

$$ \begin{cases} 1 - \ln(1+3x) = 1 + 3x\ \ \ \text{for}\ \ \ -1/3 < x < 0 \\\\ 1 - \ln(1-x) = 1 + 3x\ \ \ \text{for}\ \ \ -1/3 < x < 0 \\\\ 1 - \ln(1-x) = 1 - 3x\ \ \ \text{for}\ \ \ 0 < x < 1/3 \\\\ 1 - \ln(1-x) = -1 + 3x\ \ \ \text{for}\ \ \ 1-e < x < -1/3 \cup 1/3 < x < 1 \\\\ \end{cases} $$

FINAL EDIT

P.s. I do know there is a unique solution which is $x = 0$, it was rather intuibile. But I am demanding if, supposing we do not know anything about the solutions, the method I have used is right or not.

Proof that Dirichlet series $\sum_{n=1}^{\infty}\frac{2^{\omega(n)}}{n^2}=\frac{5}{2}$

Posted: 28 Nov 2021 11:55 AM PST

So I want to prove the following:

$$\sum_{n=1}^{\infty}\frac{2^{\omega(n)}}{n^2}=\frac{5}{2},$$ where $\omega(n)$ is the number of distinct prime factors of $n.$

I computed it to $10^{10}$ and it does seem to be slowly approaching $\frac{5}{2}.$ Also, I am aware of the following result:

$$\sum_{n=1}^{\infty}\frac{\omega(n)}{n^2}=\zeta(2)P(2),$$ where $P(2)$ is the prime zeta function.

I am not quite sure how exactly to go about this, there doesn't seem to be a way to get from the known result to the one I'm trying to solve.

Prove that an equation with two integer variables has no solution

Posted: 28 Nov 2021 11:55 AM PST

$$\dfrac{(2n)!}{((6k)n!(2^n)+1)} = n^2$$

How will you prove that it has no solution if $n$ and $k$ are integers?

Model Theory Question for Predicate Logic in van Dalen's Logic and Structure

Posted: 28 Nov 2021 11:57 AM PST

Let L be a language without identity and with at least one constant.

Let σ = ∃x1 ··· xnϕ(x1,...,xn), where σ is a formula in predicate logic.

Let Σ = {ϕ(t1,...,tn)|tᵢ closed in L}, where ϕ is quantifier free.

I want to show that:

(i) ⊨ σ ⇔ each structure A is a model of at least one sentence in Σ. (Hint: for each A, look at the substructure generated by ∅.)

(ii) Consider Σ as a set of propositions. Show that for each valuation v (in the sense of propositional logic) there is a model A such that v(ϕ(t1,...,tn)) = the interpretation of ϕ(t1,...,tn) in A, for all ϕ(t1,...tn) ∈ Σ.

This question is pg.134 #16 of Logic and Structure by Van Dalen.

My attempt to answer:

For (i), I know that ⊨ σ iff every structure A is a model of ϕ(t1,...,tn) for some t1,...,tn in A's domain. But how do I show that this means each structure A is a model of at least one sentence in Σ? I followed the hint and constructed the substructure generated by ∅, which is just a structure with its domain consisting of the constants of A and terms made by them (definition of substructure generated by a set in this linked image). I don't see how I can use this hint. I also know that ϕ(t1,...,tn) is true independent of what t1,...,tn are but how does that relate to language L?

For (ii), I'm thinking ϕ implies ϕ, so it is consistent and has a model but I feel this is wrong and I'm not sure where to correctly begin.

Help is appreciated.

Triangle Center Midpoint Proof

Posted: 28 Nov 2021 11:45 AM PST

I am working through problem 45, Stewart's calculus 6e.

Use vectors to prove that the line joining the midpoints of two sides of a triangle is parallel to the third side and half its length.

Ultimately, I am trying show the midpoint vector (line between the triangle's two midpointsenter image description here) is parallel and half the size. I have included a picture labeling everything.

The three vertices of an arbitrary triangle as vectors $\vec{A} = < a_1,a_2>$, $\vec{B} = < b_1,b_2>$, $\vec{C} = < c_1,c_2>$.

Then connect the vertices to make the lengths of the triangle: $\vec{AB} = < a_1 + b_1,a_2 + b_2>$, $\vec{BC} = < b_1 + c_1 ,b_2 + c_2>$, $\vec{CA} = < c_1 + a_1 ,c_2 + a2>$.

Next we want to define the midpoints of $AB_m = < \dfrac{a_1 + b_1}{2} , \dfrac{a_2 + b_2}{2}>$ and $BC_m = < \dfrac{b_1 + c_1}{2} , \dfrac{b_2 + c_2}{2}>$

We want to show that $\vec{AB_mBC_m}$ is half the size of $\vec{AC}$.

$\vec{AB_mBC_m} = < \dfrac{a_1 + b_1}{2} + \dfrac{b_1 + c_1}{2}, \dfrac{a_2 + b_2}{2} + \dfrac{b_2 + c_2}{2} >$

We factor the vector equation by $\dfrac{1}{2}$ :

$\vec{AB_mBC_m} = \dfrac{1}{2} < a_1 + b_1 + b_1 + c_1, a_2 + b_2 + b_2 + c_2 >$

$\vec{AB_mBC_m} = \dfrac{1}{2} < a_1 + 2b_1 + c_1, a_2 + 2b_2 + c_2 >$

But this is not equal to $\dfrac{1}{2}$ of $\vec{CA}$. Did I write something incorrectly or am I missing something?

Showing that the flow value is well defined.

Posted: 28 Nov 2021 11:41 AM PST

Let $G$ be a directed graph with edge set $E$ and $u:E \to \mathbb{R}_{\geq 0}$ a capacity function, as well as $x: E \to \mathbb{R}_{\geq 0}$ be a function. Then $x$ is called an $s-t$ flow if the following properties are satisfied:

$(a)$ $x(e) \leq u(e)$ for all $e \in E$,

$(b)$ for all $v \in V - \{s,t\}$ it holds that: $\sum_{e \in \delta^{+}(v)} x(e)-\sum_{e \in \delta^{-}(v)} x(e)=0,$ where $\delta^+(v)$ denotes the edges that are starting in $v$ and $\delta^{-}(v)$ are the edges that are ending in $v$.

The flow value $v(x)$ is now defined as $v(x):=\sum_{e \in \delta^{+}(s)} x(e)-\sum_{e \in \delta^{-}(s)} x(e)$, or equivalently $v(x):=\sum_{e \in \delta^{+}(t)} x(e)-\sum_{e \in \delta^{-}(t)} x(e)$. My question is, why are those equivalent? My idea was to sum the equation in $(b)$ over all $v \in V - \{s,t\}$, giving $$0= \sum_{v \in V -\{s,t\}}(\sum_{e \in \delta^{+}(v)} x(e)-\sum_{e \in \delta^{-}(v)} x(e)) \iff v(x)=\sum_{v \in V -\{t\}}(\sum_{e \in \delta^{+}(v)} x(e)-\sum_{e \in \delta^{-}(v)} x(e)),$$ where I am using the first definition for $v(x)$. However, I don't know how to proceed, is this last expression equal to the other definition of $v(x)$?

Is cross multiplication the right term?

Posted: 28 Nov 2021 11:47 AM PST

I always hear the term cross multiplication when it comes to equations with fractions such as $$\frac{x}{y} = \frac{a}{b}$$ where the cross multiplication is the act of multiplying $b$ and $x$, and $a$ and $y$ to get $$bx = ay.$$ What I don't get is the existence of the term at all. Isn't this just multiplication at all? This term might even get confused with the cross product.


What is the reason why cross multiplication exists even though it is just multiplication?

Factorization of $L$-functions for CM Elliptic Curves

Posted: 28 Nov 2021 11:38 AM PST

I saw recently that the $L$-functions of elliptic curves with CM can be factored as a product of simpler $L$-functions. In this question, I'd like to ask why that factorization is significant and what it tells us about the original elliptic curve. Here is the theorem in more detail:

Let $K$ be an imaginary quadratic field, and let $E$ be an elliptic curve with CM by $\mathcal{O}_K$. Suppose that $E$ is defined over a field $L$ containing $K$. Then the $L$-function of $E$ can be factored as follows: $$L(E/L, s) = L(s, \chi_{E/L}) \, L(s, \overline{\chi_{E/L}}) $$ where $\chi_{E/L}$ is the Grossencharacter of $E$ over $L$.

My question is: what is the importance of this factorization? Why is it profound / important? What "underlying truth" about elliptic curves with CM does this theorem reveal?

As an example of what I mean by the last question, here is an example where factorization of $L$-functions has a very nice intuitive meaning: given an abelian number field $K$, you can factor the Dedekind zeta function of $K$ as a product of Dirichlet $L$-functions: $$\zeta_K(s) = \prod_{\chi} L(s, \chi) $$ where $\chi$ runs over all irreducible characters of $\text{Gal }K/\mathbf{Q}$. The "underlying truth" of this theorem is that since characters are periodic functions on the integers, this theorem says that the splitting of primes in abelian extensions is governed by congruence conditions. This equality of $L$-functions is a concise way to encapsulate that fact.

Is there a similar interpretation in the case of CM elliptic curves? What concrete information about the arithmetic of $E$ is captured by the fact that you can split up the $L$-function of $E$ into the pieces $L(s, \chi_{E/L})$ and $L(s, \overline{\chi_{E/L}})$?

Counting the number of dominating rook placements in a chessboard

Posted: 28 Nov 2021 11:42 AM PST

Given a square $n \times n$ chessboard and $m$ rooks (with $m \geq \lceil{n/2}\rceil$ and $m \leq n^2$) I would like to count how many of the total $\tbinom{n^2}{m}$ possible combinations cover each "index" (more below) on the board.

This problem differs from the standard class of chess domination problems by the way covering is meant. Chessboards usually have distinct rows and columns identified by letters and numbers. In the standard chess domination problem each row and each column must be covered separately.

While in this problem the chessboard looks exactly like the normal one, the covering works differently. Here the $i^{th}$-row and the $i^{th}$-column represent the same "index". For an "index" $i$ to be covered, it is enough that one rook is placed somewhere in the $i^{th}$-row or $i^{th}$-column. While each square on the diagonal covers just one index, the other squares cover two.

When in the traditional domination problem at least $n$ rooks are needed to dominate the chessboard, here $\lceil{n/2}\rceil$ are enough.

Consider for example the following instances with $n = 4$ and $m = 2$:

Valid case                   Invalid case  |---|---|---|---|---|        |---|---|---|---|---|  |   | 1 | 2 | 3 | 4 |        |   | 1 | 2 | 3 | 4 |  |---|---|---|---|---|        |---|---|---|---|---|  | 1 |   | A |   |   |        | 1 |   | A |   |   |  |---|---|---|---|---|        |---|---|---|---|---|  | 2 |   |   |   |   |        | 2 |   |   | B |   |  |---|---|---|---|---|        |---|---|---|---|---|  | 3 |   |   |   | B |        | 3 |   |   |   |   |  |---|---|---|---|---|        |---|---|---|---|---|  | 4 |   |   |   |   |        | 4 |   |   |   |   |  |---|---|---|---|---|        |---|---|---|---|---|  

The placement on the left is valid since $A$ covers indexes $1$ and $2$ and rook $B$ covers indexes $3$ and $4$. All the $4$ indexes are covered by $A$ or $B$.

The placement on the left is invalid since the index $4$ in not covered by any rook.

When $m$ grows in size, indexes can be covered by more than one rook.

Given the explanation above, I would like to know if a polynomial algorithm/formula that given $n$ and $m$ computes how many of the $\tbinom{n^2}{m}$ possible rook placements are valid exists.

The exponential algorithm is trivial. Just iterate through all the possible $\tbinom{n^2}{m}$ placements and compute for each of them whether the placement is valid or not.

Defining the Derivative using Internal Set Theory (Non Standard Analysis)

Posted: 28 Nov 2021 11:47 AM PST

As an engineer, I have found NSA (Non Standard Analysis) to be much closer to our intuition than traditional calculus. Since there are basically two approaches to NSA, one using Hyperreals and another using Internal Set Theory (IST) I decided to take a look at both approaches. With Hyperreals, we can say that a function $f: \mathbb{R} \rightarrow \mathbb{R}$ has in a real point $a$ the derivative $m$ if for all hyperreal infinitesimal $\Delta x$

$ st(\frac{f(a + \Delta x) - f(a)}{\Delta x}) = m $.

I'm actually reading Alain Roberts's book, which employs the IST approach, and it doesn't actually define the derivative of $f$ by means of NSA alone. What it does is to keep the classical definition of differentiability (i.e: using limits) and to define the new concept of S-differentiability by saying that $f$ is S-differentiable in a point $a$ if there is a standard $m$ with

$\frac{f(x) - f(a)}{x - a} \approx m$ for all $x \approx a$.

The problem with this definition is that it's only equivalent to differentiability when $f$ and $a$ are both standard. Although differentiability could be implicitly characterized by S-differentiability by defining that $f$ is differentiable in $a$ if $(f,a)$ belongs to $\{(f,a): f\text{ S-differentiable at $a$}\}^{S}$ as the book suggests, it's much more artificial and away from our intuition than the definition using hyperreals or even the classical definition itself. Futhermore, it only defines the relation of differentiability, and not the operation of taking a derivative. My question is then the following: How can we define the derivative (or differentiability) in IST in a way that preservers intuition and doesn't fall back to classical definitions ?

Cocountable Topology is not Hausdorff.

Posted: 28 Nov 2021 11:46 AM PST

This question has been answered already, this is an attempt to rephrase it.

Let $(X,\tau)$ be a cocountable topology with $X$ uncountable.

Show that $(X, \tau)$ is not Hausdorff.

Let $r\not=s$, and $r\in U$ and $s \in V$, where $U, V$ are open and not empty.

Assume $U \cap V = \emptyset$.

$X\setminus (U \cap V) =$

$(X\setminus U)\cup (X\setminus V)$.

RHS is a union of countable sets, hence countable.

LHS is $X\setminus\emptyset=X$ uncountable, a contradiction.

Perhaps nitpicking :

$\emptyset$ is open and an element of the topological space, but $X\setminus\emptyset$ is not countable.

How do you go about this?

given function $g(X) = \operatorname{tr}(AXB)$, compute derivative wrt $X$, where $A,X,B$ are matrices.

Posted: 28 Nov 2021 11:51 AM PST

I do not want a solution, i just got a question about an equation of a derivative of a trace? I read in a book that i can apply this rule :enter image description here

and my question was if i can write $\frac{ \partial} {\partial X} tr(AXB)$ = $tr(\frac{ \partial AXB} {\partial X})$ ?

If i compute now the derivative of it then i get $tr(B^T⊗A)$ ?

Showing that $\displaystyle\limsup_{n\to\infty}x_n=\sup\{\text{cluster points of $\{x_n\}_{n=1}^\infty$}\}$

Posted: 28 Nov 2021 11:37 AM PST

Let $\{x_n\}_{n=1}^\infty$ be a sequence in $\mathbb R$. I used to follow the definition that $$\limsup_{n\to\infty}x_n=\lim_{n\to\infty}\sup_{k\geq n}x_k$$ with limits understood in the sense of the extended real number system, but recently another definition has come into my sight:

If the sequence is not bounded above, we define $\limsup_{n\to\infty}x_n=\infty$. Otherwise, we define $$\limsup_{n\to\infty}x_n=\begin{cases} \sup(c\ell)&,c\ell\neq\emptyset\\ -\infty&,c\ell=\emptyset, \end{cases}$$ where $c\ell$ is the set of all cluster points of $\{x_n\}_{n=1}^\infty$. A cluster point of $\{x_n\}_{n=1}^\infty$ is a point in $\mathbb R$ whose open balls all contain infinitely many terms (some of them may repeat) of $\{x_n\}_{n=1}^\infty$.

I would like to show that this definition implies the old one:

If the sequence is not bounded above, then $\forall M\in\mathbb R$, $\exists N\in\mathbb N$ s.t. $x_N>M$. In this case, $\sup_{k\geq n}x_k=\infty$ for each $n\in\mathbb N$, implying $\{\sup_{k\geq n}x_k\}_{n=1}^\infty\searrow\infty$. Suppose instead that the sequence is bounded above. When the sequence has no cluster points, one can prove that $\lim_{n\to\infty}x_n=-\infty$, which in turn gives us $$\lim_{n\to\infty}\sup_{k\geq n}x_k=-\infty.$$ The proof has been doing well so far, but I have no idea how to show that if $c\ell\neq\emptyset$, then $$\lim_{n\to\infty}\sup_{k\geq n}x_k=\sup(c\ell).$$ The supremum of the cluster points? What is it really? Thank you.

Numerical Integral of Complete Elliptic Integral

Posted: 28 Nov 2021 11:45 AM PST

I'm looking to numerically evaluate an integral of the form $$I=\int_0^1rK(r)f(r)\,dr$$ where $f(r)$ is a smooth function known at a set of grid points $\{r_i\}$ with error $O(\Delta r^2)$ ($\Delta r\sim10^{-3}$) and $K$ is the complete elliptic integral of the first kind. A first attempt would be to simply use the trapezoidal rule, but $K(r)$ is singular at $r=1$ so this is poorly conditioned as the grid becomes very fine. One approach I have seen is to use an asymptotic expansion of $K(r)\approx-\log\sqrt{1-r^2}$ for $r\approx 1$ and then taking $f$ to be constant in some small interval $(1-\epsilon,1)$ (chosen to fall on a grid point) so that $$\int_{1-\epsilon}^1rK(r)f(r)\,dr\approx f(1)\int_{1-\epsilon}^1-\frac{r}{2}\log(1-r^2)\,dr=\frac{f(1)}{4}\left[1+\epsilon(2-\epsilon)\log(1-(1-\epsilon)^2)+(1-\epsilon)^2\right]$$ (if I worked out the integral correctly). This approach seems very sensitive to the value of $\epsilon$ chosen, and it further assumes $f$ is constant on this interval which does not preserve the second-order accuracy. Is there a way to approach this integral that does not require an arbitrary choice of $\epsilon$, and further can compute $I$ with $O(\Delta r^2)$ error?

How to determine the bounding curve of a moving circular sector?

Posted: 28 Nov 2021 11:42 AM PST

Preamble: Consider the curve $\mathcal{C}$ formed by the segments $CD$, $DE$, $EB$ and the arc $BC$ presented below: here

Next, let $F$ be a "perspective" point and $l$ a line segment whose other end point is $A$. Suppose that we draw similar curves for each point $T$on the line segment $l$, such that the bottom segment $DE$ in the picture is orthogonal to the ray originating from $F$ and passing through $T$. Below is my best attempt to graph that this looks like at the end points of a segment from $(0, 0)$ to $(2, 0)$. (N.B., the distances are not exact in the picture, as I don't know how to use GeoGebra well).enter image description here

Question: I would like to determine the bounding curve for the shape which is obtained by the moving/painting area. That is, what is the minimal curve $\mathcal{M}$ which contains all of the "moving" curves $\mathcal{C}$?

It is quite clear that portion of the bounding curve are given by the segments $CD$, $DA$ of the leftmost area, and by the segments $AE$, $EB$ of the righmost area. What I'm struggling with is how to determine the bounding shape of the moving arc given that the line $l$ (the line segment which curve $\mathcal{C}$ moves along) and the perspective point $F$ can be be arbitary?

Finding $\int \frac{d x}{x+\sqrt{1-x^{2}}}$.

Posted: 28 Nov 2021 11:47 AM PST

I have to calculate the following integral: $$ \int \frac{d x}{x+\sqrt{1-x^{2}}} $$

An attempt:$$ \begin{aligned} \int \frac{d x}{x+\sqrt{1-x^{2}}} & \stackrel{x=\sin t}{=} \int \frac{\cos t}{\sin t+\cos t} d t \\ &=\int \frac{\cos t(\cos t-\sin t)}{\cos 2 t} d t \end{aligned} $$ I find the solution is $$\frac{\ln{\left(x + \sqrt{1 - x^{2}} \right)}}{2} + \frac{\sin^{-1}{\left(x \right)}}{2}+C$$ How can I get this without trigonometric substitution?

Recent Questions - Arqade

Posted: 28 Nov 2021 10:02 AM PST

Recent Questions - Arqade


Portfowarding problems

Posted: 28 Nov 2021 08:56 AM PST

I am looking for help since I am not sure what I should do as I believe that I have port forwarded correctly. However, I am unsure as the router I am using is a Korean one and everything is in Korean. I have had a few friends of mine try and connect but they get an error saying : No Further Information. Here is a photo of the portforwarding page. Portfowarding page

Help With Streaming GameCube Via SteamLink

Posted: 27 Nov 2021 08:11 PM PST

I'm trying to figure out how to stream GameCube Games on my steam link, and I'm not having much luck.

So far I have tried using LaunchBox, and adding it to steam manually, but once the emulator loads, I cannot control the game with the gamepad.

I've also tried RetroArch for steam, but it does not officially support GC, so I manually added it. It works when I play directly on my computer, but when I try to stream it on steam link, it either doesn't load, or crashes immediately (I cannot tell).

I've also tried using the stand alone RetroArch, and adding it manually to my library, it behaves the same exact way. What's interesting is if I try an emulation officially supported by RetroArch on steam (like SNES for example), it works exactly as you would expect.

Does anyone have any ideas on how I can stream emulators to my TV? It doesn't have to be steam link, that just seems to be the most reliable device in general for me.

Can you copy the same Animal Crossing island to two different Switches?

Posted: 28 Nov 2021 02:19 AM PST

I have one Switch (Switch-a) that I borrowed and was being used by two kids. I bought two more Switches (Switch-b, Switch-c).

Can you copy the same island to two different switches without limitations, yes/no?

If yes, how? And are there any limitations (like keeping one offline)?

From what I have read/researched, all the documentation indicates that you can move (aka "transfer". i.e. copy then delete the source island) and not copy an island. But I thought maybe there would be a way to copy the island to two Switches maybe via "backup/restore" (probably with weird restrictions somehow, like keeping one Switch offline or something).

Anyway I was just curious. In reality what I will probably do (98% confident) is:

  • transfer the island from Switch-a to Switch-b
  • on Switch-c the kid will get their own "new" island
  • I will transfer their old citizen from Switch-b to Switch-c

What mobile game is this [closed]

Posted: 27 Nov 2021 07:27 PM PST

It's a game where you play as a blue puffball and evolve and fight dungeons to save a pink puffball there was a first and second I used to play it then forgot the name

I can't figure out how to start up Minecraft Java Edition

Posted: 27 Nov 2021 04:19 PM PST

I downloaded Minecraft Java Edition on my Windows 11 and downloaded the launcher, but I can't open the actual Minecraft. When I open the launcher, it sends me to the "Welcome to Minecraft" screen and when I do press install (I pressed "I have read terms and conditions" before that) it stops on the "Making things awesome" screen.

I bought it off of the actual Minecraft site.

PS4 External drive games not showing up after database rebuild [solved]

Posted: 27 Nov 2021 08:55 PM PST

I heard I should rebuild the database on my PS4, so I did, while my external drive was plugged in. Now, none of the games on that drive are in my games folder. However, if I go to storage -> external drive -> applications, all the games are still on the disk. Is there a way to access the games without manually reinstalling them all?

Edit: so, I unplugged the external drive and rebuilt the database, then plugged it in and waited turned it on. After waiting for quite a while on the home page, my external drive games one by one gradually popped up. I don't know if the second database rebuild was necessary and I just needed to wait, but issue is solved.

How do I get my MCPE files back?

Posted: 27 Nov 2021 12:36 PM PST

I play on Minecraft PE and I accidently deleted my game files and now when I go to the games file it says it's empty. What can I do to get these files back?

Check minecraft java scoreboard leaderboards [duplicate]

Posted: 28 Nov 2021 08:14 AM PST

For various purposes, I need a way to check scoreboard objectives rather than just checking a player's scores. Is there a command I can run that can find the largest score in a scoreboard and who has it? What about the smallest? What about the 8th largest? Is there a way I can get a list of all "players" with a score of 12 in a specific objective?

This functionality feels like it should exist in minecraft; you can display leaderboards on the sidebar, for example, but I can't find a way to access them with commands. Are any of these things possible? If so, how?

Edits for clarity: I need to be able to target offline players, not just a group of online players with various scores. That is, I want to create the same functionality as the sidebar leaderboard but accessible via commands. The sidebar leaderboard displays who has the highest score in an objective, even if it's a dummy player or armorstand or something, but it only lists the top 5. Additionally, and partially related, I want to know of it's possible to create a list of all players, online, offline, or dummy, with a score of 5, or any specific number. Edit 2: The other questions that mine is being marked as a duplicate of target online players. This one wants to be able to get the score of offline players or players that don't even exist. The solutions that exist target @a or @e and systematically check if their scores are higher. @a and @e don't target offline players, however, and can't identify the true highest score the same way a scorebore sidebar leaderboard can.

Can you test for a player with a certain score in a certain area

Posted: 27 Nov 2021 10:46 PM PST

I'm making a dead by daylight map in Minecraft bedrock and I was wondering if there is a way to test if a player in a certain area has a certain score because I made vaulting with "tp @p[scores{alive=1}] ~ ~ ~" so I want to make it so only survivors who have alive 1 can do generators

How can I clear an item with custom name in Minecraft 1.16.5

Posted: 27 Nov 2021 04:20 PM PST

As mentioned in the title, I am looking for a command that will remove the item with the changed name from the player's inventory. I tried using:

/clear @p acacia_boat {{{display:{Name:'{"text":"blabla"}'}} 1  

And nothing works. I searched the internet but didn't turn up any results, and I've found no answer anywhere when trying to do this on version 1.16.5.

Is it possible to trade with villagers using some sort of score? (commands)

Posted: 27 Nov 2021 07:03 PM PST

I'm trying to make a system that transfers emeralds to a score to not take up inventory space, and that score can be used to trade. Is this possible? And if so, is it possible to display this score in the XP bar? Thanks

How to check if item exists before giving the player a new one

Posted: 27 Nov 2021 11:00 PM PST

I have tried a few ways and tried many commands but I just don't seem to get it right.

What I'm trying to do :

I have a Minecraft realm with a town center where each player can press a button, which triggers a command block, giving them one pickaxe with a unique identifier (not sure what or how). Would be nice if the pickaxe could be named after the player who pressed the button like "Minecraftuser12312 Pickaxe" but not important,

If they press the button again I need to make sure they do not have the item and if the item is also not just thrown out to pick another one up from the command block.

Any help would be appreciated <3

Things to know :

I am the realm owner and command blocks are enabled in the world.

How do I bind a command to an item?

Posted: 27 Nov 2021 11:11 PM PST

I am trying to create a few modified weapons/items in Minecraft, so that when you hit something (left click) with the specific item, it executes a command. I have already found a few answers that make it so that if you use a specific item it executes a command, but that applies for every single one of that item; for example, if a blaze rod gives you strength, every blaze rod in the game will give you strength. Is there a way to do this with only one item?

Teleporting entity through command block teleports entity to command block and stops moving, even with execute as

Posted: 27 Nov 2021 11:07 PM PST

I am using a repeating command block to repeatedly teleport a falling block with a custom tag called "Debris" 0.125 blocks on the negative z axis causes the falling block to teleport to the command block instead and not moving at all:

tp @e[type=falling_block,distance=..200,tag=Debris]  

I decided to fix this by forcing the falling block to run the command itself, instead

execute as @e[type=minecraft:falling_block,distance=..200,tag=Debris] run tp @s ~ ~ ~-.125  

and I still got the same result of the block being frozen to the command block instead. I'm not sure what I'm doing wrong here, I summoned a block with a custom tag called "Debris", then used a repeating command block to force the block to run the command itself, but it ends up acting like the repeating command block is running the teleport command instead of the block, which is supposed to be running the command because of the execute as.

Why does a serve and a fluiduct not extract creosote oil from coke oven

Posted: 28 Nov 2021 08:41 AM PST

I have 6 coke ovens producing coal coke but i cant seem to figure out why 9it wont work, in in 1.7.10 survival stories 3 (and no the tank is not full that tank goes up a lot) The coke ovens are from railcraft the fluiducts from thermal dynamics and the tank is from openblocks enter image description here

enter image description here

How long after leaving a game will a Storage Crate despawn?

Posted: 28 Nov 2021 09:04 AM PST

After our adventures out at sea, my friends and I will pack as much of our supplies as we can into a storage crate, and leave it on the dock of whatever Outpost we end up selling our final haul at. We think we're being nice by doing this, leaving a full stock of supplies to a crew and ship that might spawn at the Outpost... but is there any point to it? Do the Storage Crates despawn at some point? We have no way of sticking around after we leave the game to be sure a crate stays.

Is it possible to combine two Mario Kart Live packs to create longer courses?

Posted: 27 Nov 2021 10:25 AM PST

With a Mario Kart Live pack you get four arches and two curve signs.

To play the game multiplayer, each player needs their own Switch console and physical Mario Kart.

When playing with two players, can you use up to eight arches and four curve signs in your course?

I want to add shaders to minecraft for windows 10 but can't access files

Posted: 27 Nov 2021 07:06 PM PST

I want to add some shaders but when i run %appdata% there are no minecraft files. I can't even find where it is downloaded onto my computer. Please help me fix this issue.

How do I make a scoreboard command that detects when a player crouches in multiplayer?

Posted: 27 Nov 2021 05:00 PM PST

In Minecraft 1.13/1.14, I start with some commands that work for singleplayer like:

/scoreboard objectives add Sneak minecraft.custom:minecraft.sneak_time  /execute as @a[scores={Sneak=1..}] at (my name) run effect give (my name) minecraft:jump_boost 1 2 true  /scoreboard players reset @a[scores={Sneak=1..}] Sneak  

I've already tested it on a multiplayer server and it doesn't appear to work. I then tried adding a tag:

/execute as @a[name=(my name),scores={Sneak=1..}] at Dashinglizard run effect give Dashinglizard minecraft:jump_boost 1 2 true  

and it still didn't work.

I do building, so I'm not very good at commands

What happens when I gift someone a Battle pass who already owns it (fortnite BR)?

Posted: 28 Nov 2021 07:02 AM PST

If I try to gift a Battle Pass to a friend who already has one, will I lose V-Bucks and that person won't receive the Battle Pass or will I even be able to send the gift?

Can't download Minecraft for Windows 10 on new computer

Posted: 27 Nov 2021 07:29 PM PST

I recently got a new computer, and wanted to play with friends through Minecraft for Windows 10, but I can't figure out how to download it. Whenever I go to the game "Minecraft for Windows 10" it says I don't own it; when I go to the game titled as "Minecraft", it says I own it.
But when I click on 'Install on my devices', I get a pop-up saying

It looks like you don't have any applicable device(s) linked to your Microsoft account. to install, sign in on a device with your Microsoft account.

I am signed into my account and i don't know what else to do since the only other button on screen is "buy as gift".

enter image description here

Edit: I forgot to mention that I got the game with a code from when they were giving out codes if you bought Minecraft Java edition.

Mechwarrior (esp. Mercenaries / Vengeance) with Joystick / HOTAS on Win7x64?

Posted: 27 Nov 2021 08:05 PM PST

I've spent all day yesterday getting Mechwarrior 4: Mercenaries to work on my machine, and, behold! It finally works and runs. But all I can do is stare at the inside of my Mechs' cockpit, as I had to use the gosnoJoystick (and gosnoVideo) command line arguments to even get it to run. Playing with anything but my trusty HOTAS is no fun. =/

Are there any tricks or hacks for getting MW4Mercs.exe to run, without having to use /gosnojoystick, or some way to use my controllers even when running it with /gosnojoystick? I've got Xpadder and a few other things here... all I could think of at this point would be to somehow ghetto this and map my mouse to the stick, and create zones along my throttle to trigger key presses... absolutely no fun...

I've not yet tried to install Vengeance again, so IDK if that one behaves better than Mercs... any ideas...?

Minecraft won't update past 1.5.1

Posted: 28 Nov 2021 04:07 AM PST

When I try to log in on the first screen when you've double clicked the icon it says: "Can not connect to Minecraft.net" when I clearly have wifi. I have to play in offline mode which means I can't update it. Any help?

How do you type the '§' symbol (section sign) in Minecraft?

Posted: 28 Nov 2021 06:55 AM PST

At the moment I'm copying and pasting it but you cant copy and paste in Minecraft. How can I type it on a QWERTY keyboard?

Companions in Novigrad's Arena?

Posted: 27 Nov 2021 01:01 PM PST

During the "Finding Whoreson Junior" quest you can fight in the arena.

You have to fight several opponents but after you injure them half-way they yield and ask for mercy (at least few of the first ones), you can accept or just kill them as crowd wants it.

I managed to "save" the first one and he helped me fight in the rest of the fights, but sadly died in the process.

Anyone managed to "save" the second wave as well (brothers from Skellige I think) and keep them alive until the end?

Professor Elm is always asking about Togepi, how can I skip that?

Posted: 27 Nov 2021 04:26 PM PST

Prof Elm at the start of the game gave me an egg and it hatched as a Togepi, but I traded it to a friend time ago and now the professor is always asking about it.

Is there any way to skip that conversation via PokéGear? Am I missing something without telling him about the Togepi?

How do I beat the Homestead Innkeeper at Six Men's Morris?

Posted: 27 Nov 2021 09:21 PM PST

I've drained about 500 of my precious in game currency trying to beat the Innkeeper of the Inn in the Homestead area for an achievement. Is there a trick to beating this guy? He is like the Six Men's Morris world champion or something and has already caused me so much rage.

How to get old 16-bit Windows games to work on 64-bit Windows?

Posted: 28 Nov 2021 08:33 AM PST

Trying to play some old Windows 95 games on Windows 7 64-bit, I'm getting the following error:

The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

Trying to run the application in compatibility mode has no effect. I'm guessing these games somehow rely on 32-bit dlls which are missing from my system, and I would like to know if anyone else has encountered a similar problem and is able to give insight as to possible solutions or work-arounds.

Notes:

  • I've checked this question but it discusses system requirements and not actual application invocation.
  • The games in questions are Metal Marines and Fire Fight, but I'm sure many more might be affected.
  • The error message above is not game-specific, it comes directly from Windows itself.

V2EX - 技术

Posted: 28 Nov 2021 09:53 AM PST

V2EX - 技术


关于 adguard 和 clash

Posted: 28 Nov 2021 09:42 AM PST

家人们 我设置了安卓的 adguard 和 clash 现在可以共存了,但是这样会不会影响 clash 里面的白名单 因为我刚才看 clash 的白名单那个已经失效了 第一次用

Google 英文搜索也被内容农场污染的差不多了

Posted: 28 Nov 2021 09:17 AM PST

平常一直只用英文搜索 Google, 但是今天搜了点东西发现英文搜索也变成内容农场的形状了.
比如搜索: python os.rename force overwrite
会得到以下结果: 搜索结果

继中文搜索沦陷之后, 英文搜索也沦陷了. 各位 V 友有无对策?

如何有效防止脱发 或者怎么补救

Posted: 28 Nov 2021 09:07 AM PST

昨天和一众长辈吃饭

亲戚指着我的发际线说:"这几年看样子 xx 吃了不少苦啊"

感觉扎心了。

酒到酣处,甚至有点不是滋味。

对比一下 4 年前,这发际线真的是上移了太多了吧。

想去植发,但不知道效果怎么样。有没有朋友植了发的案例分享一下啊? 自己之前也是不太在意。

关于数据验重的问题

Posted: 28 Nov 2021 08:44 AM PST

场景:批量新增,批量修改,对某个字段进行数据库验重,需要将重复的数据标记出来。
这里考虑到一个问题,修改的时候,可能会出现两条数据的字段值互换。

Golang 的包管理一定要下下载到 GOPATH 中, 再导入到 Vendor 目录吗?

Posted: 28 Nov 2021 08:03 AM PST

Golang 包管理的疑问. 目前的创建项目的顺序是: go mod init

把可能需要的包都 go get 下载. 编写主文件. go mod tidy

go mod vendor

请教, 应该是什么样的姿势? 我希望是直接把项目依赖安装到项目目录中... 比如 npm i xxx 或者像 python 那样有个虚拟环境?

给大家看一个我上了当的 Steam 诈骗网站

Posted: 28 Nov 2021 07:05 AM PST

https://5earenas.com/

有一说一这个网站做的很有创意,通过好友信息让你帮忙投票。我没注意就输入账号密码和令牌正常登陆了,还好有令牌,马上反应过来后修改了密码。建议大家一定要绑定手机令牌啊!

PS. 不知道在这种页面中登陆后的 cookie 不知道是否会被用来做坏事,目前 PUBG 、CSGO 、库存还没看到什么异常。

nodejs 有哪些好用的增删改查框架?

Posted: 28 Nov 2021 07:03 AM PST

后端的功能是服务管理,有几十个增删改查的接口,很多接口都有时间、IP 、备注等参数,有些是必须有些是可选。如果每个接口都手动判断参数是否存在、长度是否正确、格式是否合法,写起来很累赘。最后还要数据库执行,很多接口需要分页,手动实现 SQL 也很累赘。

有没有简单易用的 nodejs 框架可实现上述提到的功能,例如参数自动校验,只需事先定义参数格式即可。分页等功能也能自动加上。

推荐个第三方群晖助手 APP

Posted: 28 Nov 2021 06:35 AM PST

看上去跟群晖 DSM 界面整合的还蛮好,没啥认知与学习成本,安装即上手。

https://toscode.gitee.com/apaipai/dsm_helper

各位 Gopher 大佬,贵公司团队开发使用的 Go 生态的相关工具、库包有哪些啊

Posted: 28 Nov 2021 05:27 AM PST

在昆明,个人公司只有两个人写 go ,使用的 gin+gorm 写 http 接口,多个服务之间调对应服务的 http 接口了,部署是打包成 image, docker compose 管理

个人目前在学习 k8s ,grpc, 之前也看了一些 go-mico go-zero 等

想了解下主流的多人开发的大概使用的技术栈 工具 或开发架构大概是什么样的,是使用上面的一些微服务框架, 还是直接基于 grpc 等自己封装 自己造?

关于 vue3 封装的问题

Posted: 28 Nov 2021 04:06 AM PST

我想封装一个prompt的功能,

<template> <a v-if="!o_visible" @click="o_handle_visible">{{o_label}}</a> <a-modal      :title="o_title"     :ok-text="o_ok_text"     :cancel-text="o_cancel_text"     @ok="o_handle_ok"     v-model:visible="o_visible" >     <a-input v-model:value="o_value" /> </a-modal> </template>  <script> import {ref, defineComponent} from "vue"; import { message } from 'ant-design-vue'; export default defineComponent({     name: 'p_prompt',     props: {         label: {             type: String         },         modal: {             type: Object         },         record: {             type: Object,         }     },     setup(props) {         let o_title = props.modal.title || "请输入谷歌验证码";         let o_ok_text = props.modal.ok_text || "提交"         let o_cancel_text = props.modal.cancel_text || "取消"         let o_visible = ref(false);         let o_value = ref("");         let o_label = props.label          let fn_reset = () => {             o_value.value = ""         }          let o_handle_visible = () => {             o_visible.value = true;         }         let o_handle_ok = async () => {             let ret = await props.modal.handle_ok(props.record, props.modal, o_value.value);             if(ret) {                 message.success(props.modal.success_text || "操作成功");                 o_visible.value = false;                 // o_value.value = "";                 fn_reset();                 return;             }         }      // __export__     return {         o_title,         o_ok_text,         o_cancel_text,         o_visible,         o_handle_visible,         o_value,         o_label,         o_handle_ok,     }     // __end_export__      } }) </script> 

这是代码

但是问题是 <a v-if="!o_visible" @click="o_handle_visible">{{o_label}}</a> 这个东西我像做成 slots, 但是做成 slots,怎么触发 o_handle_visible 事件呢 我就想和 popconfirm 一样的使用体验

<a-popconfirm     title="Are you sure delete this task?"     ok-text="Yes"     cancel-text="No"     @confirm="confirm"     @cancel="cancel"   >     <a href="#">Delete</a>   </a-popconfirm> 

大佬我该怎么封装呢?请指点下,我 vue3 菜鸟

请教一个 MySQL 死锁问题,先 delete 再批量 insert 引发的死锁

Posted: 28 Nov 2021 03:26 AM PST

隔离级别是 RR ,这里 c_id 是一个普通索引,(c_id, d_id) 是一个唯一索引。

transaction1 transaction2
BEGIN;
delete from demo where c_id = 'abc';
Query OK, 0 rows affected (0.00 sec)
BEGIN;
delete from demo where c_id = 'xyz';
Query OK, 0 rows affected (0.00 sec)
insert into demo (c_id, d_id) values ('abc', '111'), ('abc', '222'), ('abc', '333');
WAITING
insert into demo (c_id, d_id) values ('xyz', '444'), ('xyz', '555'), ('xyz', '666');
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction

最终事务 1 被回滚了。

死锁的日志关键字:

(1) WAITING FOR THIS LOCK TO BE GRANTED lock_mode X locks gap before rec insert intention waiting (2) TRANSACTION: TRANSACTION 947943174, ACTIVE 0 sec updating or deleting mysql tables in use 1, locked 1 (2) HOLDS THE LOCK(S): RECORD LOCKS space id 899935 page no 578533 n bits 200 index c_id_index of table `demo` trx id 947943174 lock_mode X (2) WAITING FOR THIS LOCK TO BE GRANTED: lock_mode X locks rec but not gap waiting 

原因基本很明确:应该是两个 delete 同时获取了 gap 或 next_key 锁,然后因为不存在记录,导致锁的范围很大,甚至是一个 ∞ 的区间,同时 insert 语句无法获取插入意向锁,并互相等待引发死锁。(这样理解对吗)

那么解决方案是什么?

不能改变隔离级别。

是否先查一下要删除的条件有没有记录,如果有,再执行删除。这样是否就可以了。

Thank you!

ddos 攻击现在少了吗?

Posted: 28 Nov 2021 12:57 AM PST

以前谷歌搜索 bot ,一大堆提供服务的,现在基本搜不到,而且很久没听说谁被攻击了。。。

gcp 哪个区最稳定

Posted: 27 Nov 2021 10:33 PM PST

试了下 gcp vps ,亚太地区非常不稳定,美区打开反应慢,出口带宽低。

初学 Android,请问下这段监听网络变化的代码在 Android 11 如何变得有效?

Posted: 27 Nov 2021 08:32 PM PST

我是在教程看到的,但是我在 Android 11 上发现不起作用了,没有报错,但是也没有达到预期的效果

public class MainActivity extends AppCompatActivity {     NetReceiver netReceiver;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          netReceiver = new NetReceiver();         IntentFilter intentFilter = new IntentFilter();         intentFilter.addAction("android.net.CONNECTIVITY_CHANGE");         registerReceiver(netReceiver,intentFilter);      }      @Override     protected void onDestroy() {         super.onDestroy();         unregisterReceiver(netReceiver);     }      public class NetReceiver extends BroadcastReceiver{         @Override         public void onReceive(Context context, Intent intent) {             Toast.makeText(context,"网络发生变化",Toast.LENGTH_LONG).show();              Log.e("mylog","网络发生变化");         }     } } 

我尝试在 AndroidManifest.xml 中添加权限,也是没有效果

     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />   

Github 趋势榜 , 大家认为容易上吗?

Posted: 27 Nov 2021 07:07 PM PST

我前几天创建的,刚刚看,居然在趋势榜上。惊喜呀。

qushibang

想找可以用来托管订阅/配置的服务 QAQ

Posted: 27 Nov 2021 06:30 PM PST

为什么会有这种需求呢?

是因为,我最近开始使用 quan X 了,然后自己做了一个配置,然后托管在 github 的私有库上了,但是这个配置的 raw 的访问是需要 token 的,而这个 token 是临时的,每过一段时间就要更新.

如果放在公有库的话,又因为我把机场的订阅也内置在配置里了,怕被盗用.现在就很矛盾...

想找一个在托管文件的网站,它需要支持直链,而且这个直链不会变更(我对文件的修改不会影响链接),同时又不是公开的.

各位帅气的小哥哥,小姐姐有没有解决的思路或者推荐的方法呢 QAQ

PS:最好是可以提供一个固定的直链和一个不需要太大的存储空间,可以随意的更改直链所链接的文件.
或者想 github 一样的私有库,但是提供了可以永久访问的直链...
( •̀ ω •́ )✧

google play 余额只能在美国使用?

Posted: 27 Nov 2021 01:04 PM PST

如题,有什么办法?有朋友在美国吗?帮忙登录一下 google play 试试

Python 版 switch 尝鲜

Posted: 27 Nov 2021 11:36 AM PST

def handle_input(self, key_event: event.Event) -> None:     for menu in self.menus:         menu.handle_input(key_event)      if key_event.type == pygame.KEYDOWN:         match key_event.key:             case pygame.K_w | pygame.K_UP:                 self.select_menu_key -= 1                 if self.select_menu_key < 0:                     self.select_menu_key = 0                 self._key_menu_select_handle()             case pygame.K_s | pygame.K_DOWN:                 self.select_menu_key += 1                 if self.select_menu_key > len(self.menus) -1:                     self.select_menu_key = len(self.menus) -1                 self._key_menu_select_handle()  

我的 vim 配色还没发识别这个最新的语法😅

FCM 有 IPv6 的推送服务器了

Posted: 27 Nov 2021 10:45 AM PST

观察了几天,有时候是 v4 的服务器地址,有时候是 v6 的地址,貌似 v6 的延迟比较大。 v6.jpg

一个诡异的问题

Posted: 27 Nov 2021 07:50 AM PST

艹,调试了一整天为什么我自定义的 axios config 不生效,最后晚上看 axios repo 的 pull request 发现是我用的那个 axios 版本自定义 config 有 bug

不懂就问, go 不是没有运算符重载吗,为什么 map 可以通过下标访问,数组比较可以用==

Posted: 27 Nov 2021 06:47 AM PST

m:=make(map[int]int) m[0]=0 //map 可以通过下标访问元素 
a:=[]int{1,2,3} b:=[]int{1,2,3} fmt.Print(a==b) //true 

Java 新手求救, jackson 反序列化, TypeReference 里面的内容还有泛型, 怎么解决?

Posted: 27 Nov 2021 05:08 AM PST

omwfYV.png omwXY6.png 这个位置怎么样才能实现动态性啊

omwxSO.png 框住的 extra 一共这么多种类型,全部继承自 AbstractExtra, 这些类实际上没有共同性, 只是为了方便,限定是 extra 我可以根据 cmd 去选择其中一个 extra 子类, 但是不知道 java 的语法怎么写

om0Cmd.png 我写了个测试, 我固定写一种 extra 的类型是可以顺利运行的, 现在是完全不知道怎么动态

XDM, gcp 突然识别我的出国小机子有挖矿行为怎么办?

Posted: 27 Nov 2021 02:07 AM PST

这个机子用了好久了,一直没问题,前天突然警告一次被停了,我删了机子重新部署,用了不倒两天 又被停了
https://s3.bmp.ovh/imgs/2021/11/f5dddbc51f3658cb.png

Recent Questions - Stack Overflow

Posted: 28 Nov 2021 06:18 AM PST

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


Why the file will be garbled after I use the EAS algorithm to encrypt base64

Posted: 28 Nov 2021 06:15 AM PST

I need to implement an encrypted interface to ensure that the returned data is not acquired. I think I can use EAS and RAS to deal with but the result outside I expect.

My achievement is like this:

  1. When the requester needs to use the request parameters to encrypt the EAS encryption, then use RSA to encrypt the EAS key to me.

  2. I use RSA to derypt the EAS key and use EAS derypt again.

  3. I handle the result of the relevant operation and return EAS encryption

Can someone help me?

(My English is not good, I hope you can understand what I mean.)

Thanks~

enter image description here

enter image description here

enter image description here

How do I make a function to print a check in j frame>

Posted: 28 Nov 2021 06:15 AM PST

Following youtube tutorials I have created a mypanel class. I overrided the paint function in the class and called drawRect() and other functions in paint(). What I want to do is to make a function which takes no of boxes as parameter and create a check. Currently I am able to make a check but since the paint() is overrided I am unable to pass number of boxes. Following is the implementation of mypanel class

package com.example;    import javax.swing.*;  import java.awt.*;    public class mypanel extends JPanel {      @Override      public void paint(Graphics g) {          super.paint(g);          int noofchecks=10;          for (int j=0;j<noofchecks;j++)          {          for (int i=0;i<noofchecks;i++){             if(j%2==0)             { if(i%2==0)              {                  g.setColor(Color.white);              }              else{g.setColor(Color.black);}}             else{if(i%2==0)             {                 g.setColor(Color.black);             }             else{g.setColor(Color.white);}}          g.fillRect(5+(i*20),5+(j*20),20,20);}      }}      public void makerect(Graphics g)      {        }  }  

and this is example class calling mypanel class

package com.example;  import javax.swing.*;  import java.awt.*;    public class example extends JFrame {      example()      {            setDefaultCloseOperation(EXIT_ON_CLOSE);          setLocationRelativeTo(null);        }      public void load(int noofchecks)      {int x=(noofchecks*20)+30;          int y=x+30;          setSize(x,y);          mypanel panel=new mypanel();          panel.setBackground(Color.white);          add(panel);        }      public static void main(String[] args)      {              example ex=new example();                      ex.setVisible(true);                      ex.load(10);        }  }  

what I want is a function such as

void printcheck(int size)  

Advice on refactoring (Python)

Posted: 28 Nov 2021 06:15 AM PST

This algorithm parses numbers from a string, any advice on how to split this large functions into smaller functions would be be apreciated. I'm often told that functions shouldn't exceed 10 lines of code but I just don't know how to refactor complex functions into smaller more comprehesible pieces.

def parse_numbers(string_to_parse):       output_array = []      indexes = [-1, -1]      has_decimal = False        string_to_parse += ' '        for i, char in enumerate(string_to_parse):          if '0123456789'.find(char) > -1:               if indexes[0] == -1: indexes[0] = i              else: indexes[1] = i              continue            if (('.'.find(char) > -1) & (not has_decimal) & (indexes[0] != -1)):             has_decimal = True             continue            if indexes[0] != -1:              if indexes[1] != -1: output_array.append(float(string_to_parse[indexes[0]:indexes[1]+1]))              else: output_array.append(float(string_to_parse[indexes[0]]))                    indexes = [-1, -1]          has_decimal = False                return output_array      example_string = 'donotparsethis . 1.1 .1. .123 .. 19.11.12'  print(parse_numbers(example_string))  

Ubuntu 20.04 WIFI

Posted: 28 Nov 2021 06:15 AM PST

I have Ubuntu 20.04.3 LTS , Previously every thing was working but now my WIFI works with my phone's hotspot but do not work with my home WIFI or any other WIFI other than phone's hotspot even ethernet cable also not working , I tried many things but none worked for me problem still persists. home WIFI connects but seems no internet and that same WIFI works on other devices.

And in my Software & Updates --> Additional Drivers : There are no drivers its empty actual message - "No additional drivers available"

So is it Driver problem ? if yes then why its working with phone's hotspot and not with home WIFI ? Please someone help me with this.

Thanks in Advance.

subset () with using a vector

Posted: 28 Nov 2021 06:15 AM PST

I have a dataset in which all countries are identified by a country code. From this dataset, however, I only need the observations from a couple of countries. I saved the country codes of the relevant countries in x. Then I wanted to use subset(), to create a new dataset:

Dset <- subset(Dataset, Dataset$countrycode == x)

which created an inconsistent dataset with the warning: Warning message: "In Dataset$countrycode == x : longer object length is not a multiple of shorter object length"

If I identify each country separately the code works...

Dset <- subset(Dataset, Dataset$countrycode == 40)

Can someone explain the problem to me, as I would like to understand it and offer a solution? Thank you in advance

how do i clear my display after 16 characters?

Posted: 28 Nov 2021 06:14 AM PST

I have a metro mo express the a 16x2 lcd screen. I am using a mpr121 touch capacitance sensor with this unit as well. What i want to happen is when i touch a sensor it displays a letter on the screen. I have this function working but what is need is it to erase the first letter after 16 have printed. so if i print hjketdhetchsudbe and the next letter is g it will erase the h at the beginning and add the g to the end jketdhetchsudbeg. here is my code so far:

#include <LiquidCrystal.h>  #include <Wire.h>  #include "Adafruit_MPR121.h"    #ifndef _BV  #define _BV(bit) (1 << (bit))  

No comments:

Post a Comment

End of Summer Sale ☀️😎

20% OFF Inside!🤯 ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏  ͏...