i3 | A fork of the i3 window manager with gaps
kandi X-RAY | i3 Summary
kandi X-RAY | i3 Summary
i3-gaps is a fork of i3wm, a tiling window manager for X11. It is kept up to date with upstream, adding a few additional features such as gaps between windows (see below for a complete list).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of i3
i3 Key Features
i3 Examples and Code Snippets
Community Discussions
Trending Discussions on i3
QUESTION
I have the following dataset:
...ANSWER
Answered 2022-Mar-17 at 05:21A possible crossprod
uct solution on a tabulation of the transaction
and product
. I'm not sure how well it will scale, but it seems to work:
QUESTION
My title is not great because I'm having trouble articulating my question. Basically, I have a DateFrame with transactional data consisting of a few DateTime columns and a value column. I need to apply filters to the dates and sum the resulting values in a new DataFrame.
Here is a simplified version of my DateFrame df
:
ANSWER
Answered 2021-Sep-28 at 02:00I kept digging and found a solution to my question with a lot of help from this answer from kait
QUESTION
I am currenlty working on a project and I'd like to use modern cpp instead of relying on old c for reading files. For context I'm trying to read wavefront obj files.
I have this old code snippet :
...ANSWER
Answered 2022-Mar-02 at 16:33I'd argue that stringstream
is not "modern C++"¹. (I'll also admit we don't have something as a good replacement for scanf
; we do have std::format
that is very nice, and replaces std::cout <<
shenanigans with a syntax reminescent of Python's format strings, and is much faster. Sadly, it hasn't hit standard libraries yet.)
I'll actually say that I think your sscanf
code is cleaner, and saner than the stringstream code: sscanf leaves things in an easier-to-understand state when parsing the line fails.
There's libraries you can use to build a line parser; Boost::spirit::qi
is probably the most well-known. You can do things like
QUESTION
This code follows the Joint account filings not the Singles account when I type in 0, I can't figure it out. Is it coded wrong? am I missing something? I cant figure out how to fix it. Thanks!
Problem Description: The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers and married filing jointly. The tax rates vary every year. Table 3.2 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.5. Table 1 2009 U.S. Federal Personal Tax Rates Marginal Tax Rate Single Married Filing Jointly or Qualified Widow(er) 10% $0 – $8,350 $0 – $16,700 15% $8,351– $33,950 $16,701 – $67,900 25% $33,951 – $82,250 $67,901 – $137,050 28% $82,251 – $171,550 $137,051 – $208,850 33% $171,551 – $372,950 $208,851 – $372,950 35% $372,951+ $372,951+ You are to write a program to compute personal income tax. Your program should prompt the user to enter the filing status and taxable income and compute the tax. Enter 0 for single filers and 1 for married filing jointly.
...ANSWER
Answered 2022-Feb-23 at 00:58Your input() call returns a string, not an integer.
QUESTION
I created var_nt
dataframe by subsetting tx_df
columns based on row variant
- "J3", "J10", "J11", "J13".
Then, I converted the var_nt
dataframe to a GRanges
object (varnt_grange
) using the makeGRangesFromDataFrame
function.
Now, I want to write a for loop to collapse the varnt_grange
into a single vector.
ANSWER
Answered 2022-Feb-19 at 23:15On each iteration, you are inadvertently rewriting over the same object, repeatedly. Instead, you can iterate over the values in gene.list$entrez using lapply
QUESTION
I have found that the BigInteger.ModPow
function in C# is very slow compared to the BigInteger.modPow
function in Java. This makes me reluctant to use C# to implement functions that perform modular exponentiation.
I have written a test program to prove it.
C#
...ANSWER
Answered 2022-Feb-14 at 07:47QUESTION
I want to load/compare/pack as runtime efficent as possible the results of 64 double comparisons into a uint64_t bitmask.
My current approach is to compare 2*2 pairs via AVX2
using _mm256_cmp_pd
. The result of both (=8) comparisons is converted into a bitmap using _mm256_movemask_pd
and via a|b<<4
assigned as byte into a union (1x uint64_t / 8 uint8_t) to save a few shifts/or's.
This example might help to visualize
...ANSWER
Answered 2022-Feb-03 at 17:08On a CPU with full-width AVX2 (like Zen2 or Haswell / Skylake), you'd probably do well with vpackssdw
/ vpacksswb
to horizontally pack down from qwords to bytes narrowing in half every time. So a total of 8 input vectors would becomes one vector that you do vpmovmskb
on (_mm256_movemask_epi8
). VCMPPD results are all-ones (-1) which stays -1, or all-zeros which stays 0, in both halves of a qword even if you use a narrower pack element size. But that packing is in-lane (within 128-bit halves of a vector), so after eventually packing down to bytes you need a vpshufb
+ vpermd
to get bytes in order before vpmovmskb
. (AMD doesn't have fast pdep
until Zen3, otherwise you could use that to interleave pairs of bits if you didn't do lane-crossing fixup shuffle.)
See How to convert 32-bit float to 8-bit signed char? (4:1 packing of int32 to int8 __m256i) for a 4:1 pack; an 8:1 makes the final shuffle more complicated unless we do more shuffles earlier, while dword chunks are small enough.
(I'm using asm mnemonic names because they're shorter to type and less clutter to read than intrinsics, and what you need to look anything up in instruction tables to find out how many uops things cost; https://uops.info/ or https://agner.org/optimize/)
But with every 256-bit SIMD operation costing 2 uops, you might do well on Zen 1 with just vmovmskpd
and scalar bit-shift / OR. If the surrounding code is all vector, having these uops use scalar integer ALUs is good. The front-end is 6 uops wide, or 5 instructions whichever is less, but there are only 4 each integer and SIMD ALU pipes, so ideally earlier and later code can overlap execution nicely. (And some specific ALU units have even more limited throughput, e.g. these shuffles on only 2 of the 4 ports.)
Or maybe one step vector packing and then _mm256_movemask_ps
? Lane-crossing shuffles are relatively expensive on Zen 1. But not too bad: vpermq
(or vpermpd
) is only 3 uops with 2 cycle throughput, vs. 2 uops with 1c throughput for vpackssdw
. (And 3 uops with 4c throughput for vpermd
.)
Assuming vpacksswd ymm
uses the same ports as the XMM version, that's FP1 / FP2. So it can partial overlap with vcmppd
which can run on FP01. (The YMM version of that also being 2 uops, 1c throughput if not mixed with other instructions.)
https://uops.info/ doesn't get that level of detail for multi-uop instructions on some AMD CPUs the way it does for Intel, but we can assume the YMM versions of non-lane-crossing versions are just two of the same uop as the XMM version where it does have that data.
You very likely don't want to use _mm256_cvtpd_ps
which costs shuffle uops and an FP->FP conversion. That costs 2 uops but only has one input vector, not two. Interpreting the compare result as a -NaN
double, you might well get a float -NaN
so it might actually work for correctness. It's definitely slower that way on most CPUs.
On Zen1 it has 2 cycle throughput, and that's per single input vector rather than a pair of vectors.
With 4x vpackssdw
we can reduce 8 vectors to 4.
Then 2x vpackssdw ymm
reduces to 2 vectors.
Then 1x vpacksswb ymm
reduces to 1 vector, with pairs of bytes in the wrong order.
For Zen 1, maybe start with 4 input vectors, and after reducing to one YMM, split it in half with vextracti128
which is only a single uop on Zen 1, for any port (since the two halves of a YMM register are already stored separately in physical registers). Then vpacksswb
the two halves together (1 uop), setting up for vpshufb xmm
(1 uop) to put pairs of bytes in the right order. That sets up for vpmovmskb
. So the only lane-crossing shuffle is just an extract.
Or instead of getting 16-bit chunks of bitmap, you could maybe do the above twice, then vinserti128 ymm, xmm, 1
(2 uops, 0.67c throughput) / vpmovmskb ymm
(1 uop) to get a 32-bit chunk of bitmap. Those 3 uops replace 2x vpmovmskb xmm
/ shl
/ or
, so you're saving a uop, and have good flexibility of what vector ALU port they can run on. Although it is more vector ALU pressure.
QUESTION
BOUNTY EDIT
Not looking for an answer - already posted and accepted one. Just trying to raise awareness with this bounty.
Original post
I have come across a nasty VBA bug that makes Property Get
procedure calls really slow. This is most likely due to a recent Office update (I have Office365). It only affects Excel on 32 bits.
The bug
Consider a class called Class1
with only the code:
ANSWER
Answered 2022-Jan-05 at 23:10I tested your example in 2013-32 with an empty class v with the 100 properties, and only got a small difference in timings. I can only assume something related with your particular setup.
However I'd say your 0.45 sec is slow even in an old system, and the reason for that is your particular use of a large Collection. Two ways to improve -
Counter intuitively with large collections it's much faster to use Keys rather than Indexes to retrieve items, populating is only slightly slower with keys. Referencing col.Item(1) is fast but bigger indexes are progressively slower, seems internally the collection is looped to find the given index each time ...
QUESTION
I'm setting up a simple GUI to display the status of network ports. If I use individual commands for each label, this works fine:
...ANSWER
Answered 2022-Jan-20 at 10:06I've managed to adjust it so you maintain the original proportions of the GUI under a class based structure:
QUESTION
I have a Python 3 application running on CentOS Linux 7.7 executing SSH commands against remote hosts. It works properly but today I encountered an odd error executing a command against a "new" remote server (server based on RHEL 6.10):
encountered RSA key, expected OPENSSH key
Executing the same command from the system shell (using the same private key of course) works perfectly fine.
On the remote server I discovered in /var/log/secure
that when SSH connection and commands are issued from the source server with Python (using Paramiko) sshd complains about unsupported public key algorithm:
userauth_pubkey: unsupported public key algorithm: rsa-sha2-512
Note that target servers with higher RHEL/CentOS like 7.x don't encounter the issue.
It seems like Paramiko picks/offers the wrong algorithm when negotiating with the remote server when on the contrary SSH shell performs the negotiation properly in the context of this "old" target server. How to get the Python program to work as expected?
Python code
...ANSWER
Answered 2022-Jan-13 at 14:49Imo, it's a bug in Paramiko. It does not handle correctly absence of server-sig-algs
extension on the server side.
Try disabling rsa-sha2-*
on Paramiko side altogether:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install i3
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page