Questions tagged [hardcode]

It is the development practice of writing data considered as configuration or input directly in source code.

Hardcoding is considered a bad practice, source code must be changed every time programmer want to change the hardcoded data. It is commonly used when writing programs that should accept user's input, to avoid complexity the programmer should prefer hardcode the input data in the source code instead handle real input.

153 questions
0
votes
2 answers

How to hardcode the settings

How can I hardcode the settings of the initiator and the acceptor, so that I don't need an external settings file? This is what I've tried so far: FIX::SessionSettings serverSettings; FIX::Dictionary…
Qsiris
  • 1,143
  • 1
  • 13
  • 27
0
votes
3 answers

should i use the web framework for implementing a bunch of external links that likely won't change?

i'm building my webapp using the wicket java web framework. there is one page that i'm building right now contains 20+ external links, a lot of them are pointing to the wikipedia pages. i'm currently hardcoding the url for all these links in the…
fei
  • 2,224
  • 9
  • 31
  • 36
0
votes
1 answer

Wordpress po/mo classes

I am trying to make a simple system with plugin and themes support, but I need translation for them. The file path of languages with /en/LC_MESSAGES is too big and I want simple and it should be put only in languages folder of the plugin, just like…
Vinicius Tavares
  • 666
  • 7
  • 28
0
votes
1 answer

Hard Coding a button to an IBAction in xcode

when I google the title of my question I get another stackoverflow question that was answered that has been really helpful and explains most of what I need to do with hard coding a button. The problem is that when it is tied to an action it…
Pkolms
  • 7
  • 3
-1
votes
1 answer

Returning default values in SQL queries

I have a query in SQL where I select a couple of attributes from a few tables. However, I also need to return default hardcoded values such as 'HardCodeValue' in the results. I am not querying a table/column however for this but I do want a column…
DonalDraper
  • 5
  • 1
  • 4
-1
votes
1 answer

How to safely hardcode an authentication token within an application code - Java

I know that hardcoding passwords into a program is something insecure by nature. Most of them can be cracked by reverse engineering tools such as IDA Pro. However, if one had no choice other than to do so, would there be a secure way to do it? I…
user1060551
  • 421
  • 2
  • 11
  • 20
-1
votes
4 answers

(SQL) find oldest person in table (avoid hard code)

I'm trying to find the oldest person at my table. And I have all person's birthdates. I write code like this: SELECT TIMESTAMPDIFF(day, birthdate, '2021-09-12') AS 'Age' FROM table ORDER BY age limit 1 but I think this is hard-coding. How can I…
island1996
  • 47
  • 5
-1
votes
1 answer

How to read from an existing .txt file without hard coding (winforms)?

I am working on a project with winforms. I want to read from an existing .txt file but without hard coding. This means that I want to allow the user to provide the path of the file as input. I have tried the following code: private void…
user12170668
-1
votes
1 answer

How to write a macro in Excel that will hardcode all the cells in a workbook that contain formulas with the letter "CIQ"?

I am working on a spreadsheet that is pulling a lot of data from Capital IQ (CIQ). I would like to hardcode all these formulas. If somebody that doesn't have the CIQ plugin tries to look at the spreadsheet, all they see is #name and #value. I don't…
-1
votes
2 answers

How to hard-code static relational data with base class?

In my application I need to have access some "relational" data at runtime. If I had a lot of data or it changed often I'd store it in a DB (sqlite or something). But I only have a couple of entities with 5-50 objects that won't change (often) and…
Morrandir
  • 595
  • 1
  • 4
  • 19
-1
votes
1 answer

How to hardcode login for username and password?

I have this windowadmin table. I would like to hardcode it for the 4th record in the table. If user key in username = Admin and password = 123, log him in. Below are my images and the codes. Thank you very much. private void…
Pony
  • 401
  • 3
  • 13
  • 43
-1
votes
3 answers

Black box test plan to see whether a value is hard coded

I need to make a manual test plan (black box testing) to see whether a value is hard coded in a drop down list (its' the acceptance criteria). Can anybody give me any suggestions on that? Thanks in advance Saj
-1
votes
1 answer

How can I hardcode input with the "select" system call in C?

If I understand this system call "select" correctly,
Archer
  • 111
  • 3
  • 10
-2
votes
2 answers

hard coded values in dart

What are hard coded values and how do we use it in Dart? I need some examples with code and explanation. Thank you, God bless you new to flutter and dart
-2
votes
2 answers

function writing function in JS

I have functions in JS that must be hard-coded for some reason. How do I make a function that writes this hard-coded function? Here's my example; assuming obj is a multi-array/JSON object: function foo2(obj) { var t = obj["key1"]; t =…
Keng
  • 854
  • 10
  • 10
1 2 3
10
11