问题标签 [transpose]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
8 回答
6381 浏览

java - 在java中转置和反转置字符串

我一直在研究两种分别转置和反转置字符串的方法。据我所知,我提出的解决方案都有效。我只想知道我是否可以用更简单的方式解决这些问题。我的代码似乎对于正在执行的任务来说太长了。第一个方法 transpose() 将一个字符串作为参数并转置它。如果输入“bridge”,输出将是“bergid”。同样,使用 unTranspose() 方法,如果用户输入“bergid”,则输出将是“bridge”。

我的代码看起来很糟糕。我仍然不习惯正确格式化我的代码。请多多包涵。

谢谢你的时间


定义

0 投票
3 回答
1160 浏览

c - 转置矩阵

我想转置一个矩阵,这是一项非常简单的任务,但它不适用于我:

更新

我正在转置第一个矩阵并将其存储在第二个矩阵中。两个数组指向相同的结构,我需要两个数组(目标和源),以便稍后显示它们以进行比较。

我认为这是正确的方法,但显然对于矩阵,例如:

我得到:

问题是什么 ?

请帮忙,谢谢!

0 投票
1 回答
2035 浏览

excel - 如何使用 excel 的 10,000 行限制进行转置?

我正在尝试转置所有列“B”,但想跳过一行然后抓取下一个 4 并将它们粘贴到同一列中。如何使这个循环所有列“B”跳过每 5 行并自动将范围更改为下一个打开的单元格或“范围”,而无需单独手动输入每个单元格?

0 投票
1 回答
800 浏览

sql - 从行转置为列

我有一张这样的桌子:

我想把它转换成这样的东西:

如何使用 MS SQL 2000 做到这一点?我试图寻找解决方案,但找不到最合适的解决方案。

0 投票
1 回答
119 浏览

asp.net - 转置和数据绑定()后如何获取xml html

我有一些使用 xsl 和 xml 的代码。Xml 控件位于设计页面上。xml 控件 id 是 xmlApplication 生成 xml 字符串,xsl 具有包含所有表格和单元格等的格式。这是生成最终产品的页面代码的一部分,该产品以某种格式显示 xml。

我猜在 xmlApplication.Databind() 之后,xmlApplication 会被转换成可以放在里面的东西。是否可以作为字符串抓取?

如果我对此有错误的想法,请告诉我。

非常感谢。

0 投票
2 回答
359 浏览

sql - sql selectL行到没有子查询的列

我在 Oracle 10g 中有一个表,其中包含如下一些信息:

我想提取所有具有 GRUPO='VTOS' 的行并将这些行转置为列。CODIGO 中的值是预先确定的(我知道哪些值可以存储在该列中),所以想得到这样的东西:

我知道我可以用一些子查询来做到这一点,例如:

但我想找到一种更有效的方法。谁能建议怎么做?

0 投票
1 回答
418 浏览

keyboard - Random keyboard key assignment corruption in Windows XP

Manually Migrated to Super User:

Random keyboard key assignment corruption in Windows XP

This isn't a programming question but I'll try to get away with it. WinXP SP3 machine. Every so often (sometimes several times a day) my keyboard (or Windows, or something) decides that it is going to translate the keys I am typing. It's always the same behaviour : specifically

  • Q and A are transposed.
  • W and Z are transposed.
  • the digit keys (the row below the F1-F12 keys) become random punctuation characters.

and several other random shufflings of keys occur. Interestingly:

  • the numeric keypad still works
  • the corruptions are always associated with a particular application. Exiting the application (e.g. Delphi, or Chrome), and restarting the app. cures the problem.
  • the same problem occurs on my laptop at home, I guess because I run the same apps.
  • Ctl-Q and Ctl-A are also transposed

I'm convinced that something I'm running is trashing something but I have no idea where to look. I'm hoping someone reads this and says "oh yeah..."

Yes, I have AV software running.

0 投票
1 回答
1324 浏览

javascript - 是否有将列显示为行的 JavaScript 数据表组件?

我想显示一个“翻转”(转置)数据表。例如给定一些数据:

[{col1: "abc", col2: 123}, {col1: "xxx", col2: 321}]

它显示为

+------+-----+-----+
| col1 | abc | xxx |
+------+-----+-----+
| col2 | 123 | 321 |
+------+-----+-----+

行的行为应与标准表中的列相同。

是否有一些 JS Ajax 组件(如 YUI DataTable 或类似的)可以做到这一点?

0 投票
6 回答
17102 浏览

c - 如何转置非方阵?

我有这个用于转置矩阵的代码:

它似乎适用于方阵,但不适用于非方阵。帮我!

0 投票
1 回答
9255 浏览

c++ - 如何使用 uBLAS 转置矩阵?

我是 C++ Boost uBLAS 库的新手,所以我有一个菜鸟问题 - 如何使用这个库转置矩阵?我在这里找不到问题:

http://www.boost.org/doc/libs/1_44_0/libs/numeric/ublas/doc/html/index.html