问题标签 [hardcode]

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 投票
1 回答
187 浏览

date - 计算字段是否允许硬编码日期?

我正在尝试创建一个计算字段来确定日期字段和另一个硬编码日期之间的持续时间,如下所示:DIFFINDAYS(test_datefield, "19-Dec-16"),但它不起作用。

CRM 2015 或 2016 有可能吗?

0 投票
1 回答
1442 浏览

powershell - 如何在 powershell 脚本中硬编码特定的服务器名称

我想重新启动特定服务器,我正在使用 findstr 在 1000 台服务器列表中查找特定服务器,但是,有什么方法可以在脚本中硬编码服务器名称,以便脚本仅在一组特定的远程服务器上运行?另外,如何针对每个数组变量使用。例如,下面的方法是否正确?

0 投票
1 回答
49 浏览

python - Using Table with Python

I need to incorporate a table into my python program so when I run my program it can read the information from the table as it is needed. What is the best way to incorporate the table into my program so that it is familiar with it when the program is ran?

This is the table that I will incorporate into my program:

enter image description here

0 投票
1 回答
1302 浏览

ios - 如何使用 iOS VideoToolbox 和 FFMPEG 对 MP4 流文件进行硬编码?

伙计们!

我在 github 中找到了一个演示:-VideoToolboxDemo。而且我还在stackoverflow how-to-use-videotoolbox-to-decompress-h-264-video-stream中发现了一个问题,有人在github中实现了这个问题:https://github.com/lileilei1119/VTDemo

但是他们在寻找 SPS 和 PPS 方面存在差异。

VideoToolboxDemo 是:

它使用来自 FFMPEG 的 pCodecCtx 的额外数据来查找像 0x00 00 01(或 0x00 00 00 01)这样的起始代码

但是stackoverflow中的介绍是:

使用数据包的数据?

这两种方法我都试过了,还是找不到SPS和PPS的起始码。有谁知道为什么?我的文件有问题吗?

我的 mp4 文件是 http://7u2m53.com1.z0.glb.clouddn.com/201601131107187320.mp4

0 投票
2 回答
65 浏览

java - 整数应该包含在 strings.xml 文件中吗?

如果我有一个属性为

它应该包含在@string 文件中还是可以在activity_main 中硬编码?

0 投票
3 回答
287 浏览

ruby - 对做同样事情的许多不同方式感到困惑

我目前正在 Codecademy 的 Ruby 课程和“哈希和符号”部分学习。这是我正在使用的代码:

此代码的目的是如果在字符串中遇到“s”,则将字符串的元素添加到符号变量中。但是,代码没有通过。我查看了一个解决方案,发现了这个:

我的问题是,Ruby 是否接收到数组中实际的“s”。这对我来说似乎是硬编码???

0 投票
4 回答
962 浏览

php - laravel编程中的字符串资源?

有什么方法可以代替刀片中的硬编码字符串,而是使用字符串资源(或字符串表)之类的东西,所以如果你更改字符串,每个刀片都会被更改。例如,我没有在刀片中存储编码“产品”,而是使用了一个名为“string1”的变量,因此如果有一天我将 string1 值更改为“服务”,每个刀片都会受到影响并且正常。

0 投票
2 回答
199 浏览

c++ - 是否可以根据另一个硬编码数组的数据自动生成硬编码数组?

例如,我有一个对数组(它是一个静态变量)a[],它表示点 A、B、C 的坐标:

我想要另一个数组 b[] 来存储 AB 和 BC 的长度:

但是 b[] 不是很容易维护,因为如果我向 a[] 添加元素,我需要手动更改 b[]。有没有可以自动生成 b[] 的方法?有没有类似的东西,例如:宏

或者

或模板:

或其他允许我更改 a[] 大小而无需手动更改 b[] 甚至不需要修改代码的其他部分的设计模式?

0 投票
3 回答
5931 浏览

javascript - 硬编码的 URL

我有一个关于硬编码网址的查询。当使用 jquery 从 JavaScript 进行 post 调用时,我这样做 $.post('http://localhost:8000/timer/check/'

现在这在我的开发服务器上工作正常。当我必须在另一台服务器上部署它时,我必须手动更改代码中的所有 url。那么如何避免硬编码网址呢?

0 投票
1 回答
21 浏览

windows - We need to hardcode arguments so all the user need to do is just needs to run the bat file to upgrade the license

We have an updated license stored in the file 'style.mfx'. We want to send to user and have it silently replace the old file by that name. The File will always be in c:. I've tried this demo with no luck. I want to hard code targetName and replacementFile in the batch file.

cmd line isn't even working! but I want the arguments in the batch file...

Any help would be appreciated.