XQuery有一组用于日期转换的有用函数.但是如何将"今天"和"昨天"等相关日期转换为实际日期?
例如,"今天,17:33"应转换为"2012-05-30","昨天,22:13"应转换为"2012-05-29".
我正在尝试将包含A列中某个单词的单元格(例如"Hello")与右侧的单元格合并(在B列中)
例如A4 = 'Hello',因此我想合并单元格A4和B4.
到目前为止我有这个代码:
function formatCells() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName('Combined');
var range = s.getDataRange()
var values = range.getValues();
for( var row = values.length -1; row >= 0; --row )
if (values[row][1] == 'Hello')
{s.getRange(row+1,1).mergeAcross();
}
}
Run Code Online (Sandbox Code Playgroud)
但代码似乎根本没有做任何事情?那里的任何人都可以告诉我我做错了什么吗?
非常感谢您的期待.
我有控制器,我尝试从电子邮件服务器获取INBOX文件夹.下载一切都很好.我可以把这些数据(电子邮件主题,从,日期)放到TableView中但是......只有当我在等待负责在TableView中设置这些数据的线程时.码:
// The table and columns
@FXML
TableView<MainModel.Item> itemTbl;
@FXML
TableColumn itemNameCol;
@FXML
TableColumn itemQtyCol;
@FXML
TableColumn itemTitleCol;
// The table's data
static ObservableList<MainModel.Item> data;
public void dataSet(){
// Set up the table data
itemNameCol.setCellValueFactory(
new PropertyValueFactory<MainModel.Item,String>("name")
);
itemQtyCol.setCellValueFactory(
new PropertyValueFactory<MainModel.Item,String>("qty")
);
itemTitleCol.setCellValueFactory(
new PropertyValueFactory<MainModel.Item,String>("title")
);
data = FXCollections.observableArrayList();
itemTbl.setItems(data);
}
public void setEnemyEvent() {
itemTbl.addEventFilter(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
if (event.getClickCount() == 2) {
if(itemTbl.getSelectionModel().getSelectedItem()!=null){
System.out.println(itemTbl.getSelectionModel().getSelectedItem().name);
}
}
}
});
}
@Override
public void …Run Code Online (Sandbox Code Playgroud) 我在运行脚本时遇到以下错误.该脚本试图调用webservice..and它成功调用webservice.最后..它还打印了成功的消息,只是在它之间抛出一些带有LOG UTILS的错误.请看看并建议..
java.lang.IllegalArgumentException: port out of range:67001
Run Code Online (Sandbox Code Playgroud)
java.lang.NullPointerException
at com . drivelogic.services.logging.LogConfig.isDevMode(LogConfig.java:89)
at com.drivelogic.services.logging.DlLogger.isTraceLog(DlLogger.java:277)
at com.drivelogic.services.logging.DlLogger.log(DlLogger.java:55)
at com.drivelogic.common.util.LogUtils.log(LogUtils.java:114)
at com.drivelogic.common.util.LogUtils.fine(LogUtils.java:252)
at com.cccis.frm.reprocess.util.PublishUtil.invokeWebService(PublishUtil.java:304)
at com.cccis.frm.reprocess.batch.SOABatchReprocessor.reprocess(SOABatchReprocessor.java:137)
at com.cccis.frm.reprocess.batch.SOABatchReprocessor.main(SOABatchReprocessor.java:56)
Run Code Online (Sandbox Code Playgroud)
java.lang.IllegalArgumentException: port out of range:-2
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:83)
at weblogic.socket.SocketMuxer.newSocket(SocketMuxer.java:373)
at weblogic.socket.SocketMuxer.newClientSocket(SocketMuxer.java:383)
at weblogic.socket.ChannelSocketFactory.createSocket(ChannelSocketFactory.java:86)
at weblogic.socket.BaseAbstractMuxableSocket.createSocket(BaseAbstractMuxableSocket.java:133)
at weblogic.rjvm.t3.MuxableSocketT3.newSocketWithRetry(MuxableSocketT3.java:214)
at weblogic.rjvm.t3.MuxableSocketT3.connect(MuxableSocketT3.java:383)
at weblogic.rjvm.t3.ConnectionFactoryT3.createConnection(ConnectionFactoryT3.java:34)
at weblogic.rjvm.ConnectionManager.createConnection(ConnectionManager.java:1784)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:1424)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:443)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:321)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteCluster(RJVMFinder.java:316)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:205)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:353)
at weblogic.jndi.Environment.getContext(Environment.java:315)
at weblogic.jndi.Environment.getContext(Environment.java:285)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at …Run Code Online (Sandbox Code Playgroud) 我正在使用XSLT和XML来生成输出文档。
我在数据中所拥有的(我无法控制的XML形式)如下:
<ea type="null"/>
<pa type="null"/>
<perf>4</perf>
Run Code Online (Sandbox Code Playgroud)
我需要在计算中使用这些。我看到为这些提供默认值需要对文档进行转换以提供有点冗长的默认值。
所以我想,在XPath / XSLT中是否存在类似于PHP的三元运算:
$result = ($var == null ? true:false)
Run Code Online (Sandbox Code Playgroud)
以便以下提供结果(即使它为零)
<xsl:value-of select="ea + pa + perf" />
Run Code Online (Sandbox Code Playgroud) 如果我使用具有到期日期的OpenPGP密钥签署git commit,那么对于在到期日期之后查看该提交的人来说意味着什么?这样用于提交签名的所有键是否应该是永久性的?
如果验证方收到我的新钥匙怎么办?还是我的老?或两者?
我是OpenPGP的新手,特别是在签署git commit方面。
在《Pro Git,标记你的版本》一书中:
\n\n它展示了一种将公钥收集到 git\xef\xbc\x8cs 中的 blob 中的方法,以便同步它的用户可以添加该公钥并验证签名的标签。
\n\n这种方式真的安全吗?有人可以更改公钥 blob 并重做签名。我认为我们应该从单独且授权的方式获取公钥,对吧?
\n\n书中的命令粘贴如下:
\n\n$\xc2\xa0git\xc2\xa0tag\xc2\xa0-s\xc2\xa0v1.5\xc2\xa0-m\xc2\xa0\'my\xc2\xa0signed\xc2\xa01.5\xc2\xa0tag\'\nYou\xc2\xa0need\xc2\xa0a\xc2\xa0passphrase\xc2\xa0to\xc2\xa0unlock\xc2\xa0the\xc2\xa0secret\xc2\xa0key\xc2\xa0for\nuser:\xc2\xa0"Scott\xc2\xa0Chacon\xc2\xa0<schacon@gmail.com>"\n1024-bit\xc2\xa0DSA\xc2\xa0key,\xc2\xa0ID\xc2\xa0F721C45A,\xc2\xa0created\xc2\xa02009-02-09\n\n$\xc2\xa0gpg\xc2\xa0--list-keys\n/Users/schacon/.gnupg/pubring.gpg\n---------------------------------\npub\xc2\xa0\xc2\xa0\xc2\xa01024D/F721C45A\xc2\xa02009-02-09\xc2\xa0[expires:\xc2\xa02010-02-09]\nuid\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0Scott\xc2\xa0Chacon\xc2\xa0<schacon@gmail.com>\nsub\xc2\xa0\xc2\xa0\xc2\xa02048g/45D02282\xc2\xa02009-02-09\xc2\xa0[expires:\xc2\xa02010-02-09]\n\n$\xc2\xa0gpg\xc2\xa0-a\xc2\xa0--export\xc2\xa0F721C45A\xc2\xa0|\xc2\xa0git\xc2\xa0hash-object\xc2\xa0-w\xc2\xa0--stdin\n659ef797d181633c87ec71ac3f9ba29fe5775b92\n\n$\xc2\xa0git\xc2\xa0tag\xc2\xa0-a\xc2\xa0maintainer-pgp-pub\xc2\xa0659ef797d181633c87ec71ac3f9ba29fe5775b92\n\n$\xc2\xa0git\xc2\xa0show\xc2\xa0maintainer-pgp-pub\xc2\xa0|\xc2\xa0gpg\xc2\xa0--import\nRun Code Online (Sandbox Code Playgroud)\n 在谈到Git时,我有点像新秀.所以我决定阅读Scott Chacon的Pro Git.BTW好书,强烈推荐它.
无论如何得到了关于签名标签的部分.要使用GPG对标签进行签名,您必须设置私钥.但是,当我跑:
git tag -s v1.6 -m "my signed 1.6 tag"
Run Code Online (Sandbox Code Playgroud)
我得到以下内容:
C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag"
gpg: error loading `iconv.dll': The specified module could not be found.
gpg: please see http://www.gnupg.org/download/iconv.html for more information
gpg: skipped "Name <name@gmail.com>": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
Run Code Online (Sandbox Code Playgroud)
所以,我完成了错误消息告诉我要做的事情,然后转到链接并按照说明进行操作.我将iconv.dll复制到包含gpg.exe(\ Git\bin)的文件夹中.再次执行命令并得到:
C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag" …Run Code Online (Sandbox Code Playgroud) 我在教自己SQL Server是一种爱好.我一直坚持将数据插入关系表,我理解关系表的想法.
我想知道是否有人可以告诉我如何获得先前插入的行存储的标识它作为变量在其余查询中用作FK.
这是我的TSQL代码:
CREATE PROCEDURE [dbo].[q_insertuser]
@username varchar(50),
@hash varchar(MAX),
@name varchar(50),
@email varchar(MAX),
@address varchar(MAX),
@city varchar(50),
@postcode varchar(50)
AS
--INSERT USERNAME
INSERT INTO tab_user
(username)
VALUES
(@username)
--Selects the Userid to be used
DECLARE @UID INT
SET @UID = INT FOR SELECT *
FROM tab_user
WHERE (userid = SCOPE_IDENTITY())
--INSERT PASSWORD
INSERT INTO tab_pass
(userid, hash)
VALUES
(@UID ,@hash)
--INSERT Address
INSERT INTO tab_contact
(userid,name, email, address, city, postcode)
VALUES
(@UID ,@name, @email, @address, @city, @postcode)
--RETURN …Run Code Online (Sandbox Code Playgroud) 我usr/bin/xpath5.16在外壳程序脚本中使用xpath(如Mac OS X 10.9中提供的)来解析XML文件中的某些值,效果很好。但是,它给了我一些我不想在脚本中看到的详细输出。我实际上只想将结果(属性的内容)存储在变量中。
content=$(xpath ../../AndroidManifest.xml /manifest/@android:versionCode)
echo "$content"
Run Code Online (Sandbox Code Playgroud)
执行后,该变量content确实包含该属性的内容,但是我也想摆脱一些冗长的输出。这里是:
Found 1 nodes:
-- NODE --
android:versionCode="38"
Run Code Online (Sandbox Code Playgroud)
注意:输出末尾的“ 38”源自echo "$content"其余的行xpath。