Questions tagged [hard-coding]
40 questions
0
votes
2 answers
Is it hardcoding to type out values in a formula?
I am working on a class assignment and one of the things covered in this weeks text is hardcoding and how it is frowned upon.
My question is if I physically put in a value that is part of the formula, is that considered hardcoding?
example: the…

Jeffrey Quinn
- 207
- 1
- 13
0
votes
2 answers
Dictionary Writing and Hard-Coded Entries
TypeError: Can't convert 'NoneType' object to str implicitly. That is the error I get when I try to hard-code an entry into a dictionary by using a function. Having user input works, and puts it into the dictionary, but this won't work. I've…

Justin
- 283
- 2
- 5
- 11
0
votes
1 answer
what is hardcoding in c++, and how can fix this?
ok so i got marked off on my program for hard coding, but not sure what i did wrong, here is a part of my program that was 'hardcoded'
cout << "Tax $" << (meal_price * guests) * TAX << endl;
cout << "Tip $" << (meal_price * guests + meal_price *…
0
votes
4 answers
Alternative practice for hard coding text strings in a Java program?
In my program I have lots of string and repeated strings. Is there a way to separate the text strings from the source code. I do not want to hardcode the string within my program.
In PHP I used to have a file with list variables for each string. But…

malhobayyeb
- 2,725
- 11
- 57
- 91
0
votes
2 answers
How can I connect to LDAP from a smartphone without hardcoding the password?
Our Android app connects to an LDAP db for authentication and user data (email address, phone number, etc.). Until now, the app has connected to a piece of middleware that opens the connection to LDAP and performs operations for the app. The app…

AlbeyAmakiir
- 2,217
- 6
- 25
- 48
0
votes
4 answers
How to refer dynamically to another database user?
I've a case in which I need to refer to another database user. I've to hard code database user name in view while referring to it.
SELECT * FROM eg001t3.DUAL; // example.
Is there a way to refer to that db user (eg001t3) from view dynamically or…

Ahmed Atia
- 17,848
- 25
- 91
- 133
-1
votes
3 answers
Index 12 out of bounds for length 12. How can I fix this problem?
Everytime I run the code I get an Index 12 out of bounds for length 12. I'm not sure what is the problem.
Here is the code:
enter code here: int getDayNumber(int day,int month,int year) {
if(this.leapYear(year)) {
int months[] =…

Saitou9
- 9
- 1
-1
votes
2 answers
How can I get a cell within a range to hardcode once the cell changes?
I need to get a cell within a range to hardcode when a status is selected in another column (same row) on the worksheet. The purpose is so I can measure how long a new hire candidate sits in each step (or status) of the hiring process.
I've tried…

PamelaG
- 11
- 2
-1
votes
1 answer
Avoid hardcoding messages in java classes
Here's a sample code:
toastMessage = "Data added successfully";
...
Toast.makeText(this, toastMessage, Toast.LENGTH_SHORT).show();
In this way, users only can interact with the English language, What can I do, if I wanted to show messages like…

Pedram
- 557
- 5
- 17
-1
votes
1 answer
How to remove non-breaking spaces from HTML hard coding
I know this has been asked before in different ways, however, I am new to Javascript coding and don't entirely understand how to tailor the advice for my issue.
I am trying to remove the " " from the line of hard coding below... actually, if I…

Jason Tilton
- 1
- 1