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

Hardcoding Area, City, Country Strings

There can be potentially up to 1000 strings in total. Should these be hardcoded or stored in database? These are frequently accessed because everytime user wants to register or checkout an item, they are going to need to see list of …
user1955934
  • 3,185
  • 5
  • 42
  • 68
0
votes
3 answers

Access dictionary with elements from array softcoded

I have a dictionary created from JSON. I would like to access items in the dictionairy through arrays containing their keys. Visualised JSON: { "name": "Chiel", "industry": { "IndustryName": "Computer Science", "company": { …
Chiel
  • 662
  • 1
  • 7
  • 30
0
votes
1 answer

Lint report "Hardcoded Package in Namespace"

today when I want to get a release from my project , android studio show this errorr: android { lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but…
Amir133
  • 2,372
  • 2
  • 18
  • 34
0
votes
0 answers

Adding SQL parameters via C# doesn't work, but hard-coding within stored procedure does?

I'm passing an id to a stored procedure, and that procedure returns XML to me (well, supposed to). If I don't add parameters from my C# but instead hard code them into my procedure, I get all the XML I ever wanted. On the flip side, I get nothing as…
midoriha_senpai
  • 177
  • 1
  • 16
0
votes
1 answer

Iterate models without hardcoding it with R

I have this code # [1] "X6" "X5" "X7" "X4" "X3" "X8" "X19" "X9" "X10" "X16" formula = result ~ X3+X4+X5+X6+X7+X8+X9+X10+X16+X19 full_magnetude_model = glm.fit <- glm(formula, data = train) full_magnetude_predict =…
Hartun
  • 113
  • 3
  • 10
0
votes
2 answers

Tree structure of values: avoid hardcoded values in Typescript

I am a Java developer, when I want to avoid hardcode values directly in the code, sometimes I create a 'tree' of values like this: public class Values { public static final class Development { public static final class Environment { …
svprdga
  • 2,171
  • 1
  • 28
  • 51
0
votes
3 answers

How to hard code spaces at end of result?

I need to add spaces to the end of a column I have called NPI (nvarchar(20)). NPI is always 10 digits, but the requirements for the report want the first 10 digits to be the NPI followed by 10 spaces (text file formatting issues I assume). I have…
0
votes
1 answer

AWS Migration - Hardcoded IP addresses

We are looking to migrate to AWS in the start of the new year. One of the issues we have is the fact that some of the applications that we will be migrating over have been configured with hardcoded IP addresses (DB Hostnames). We will be using ELB's…
0
votes
2 answers

Unable to hardcode JSON response

I'm currently working with Angular 5.1.2 and i'm trying to get objects from http requests. In order to verify my code, I've hardcoded a JSON response and created a Python Anywhere's web service, here's what I did : HTTP/1.1 200…
Tolemack
  • 47
  • 3
0
votes
3 answers

Manually write a url query string containing nested array data

I'm looking to manually write a multidimensional $_GET query string, saw this done the other day, but can't quite remember it! something like: www.url.com?val1=abc&val2=cde&[val3=fgh&val4=ijk]
Haroldo
  • 36,607
  • 46
  • 127
  • 169
0
votes
5 answers

Java - Is it better to pass reference or work with hardcoded objects if possible

Is it worth to make better code (ClassB) instead of going with two separate check methods? So main question is: am I right when assuming that Class A is a bit faster than Class B, or is its difference doesn't really matter and passing variables…
abvgde
  • 41
  • 6
0
votes
3 answers

C# Combobox hardcoding values

So I have a combo box called cboGender, I want to add values (hard code the values) to the combo box like Male, Female and Unspecified. How do I go about doing it? Thanks in advance.
Nicz
  • 49
  • 2
  • 9
0
votes
1 answer

What is the best way to populate DropDownLists with many entries in ASP.NET MVC

I have a DropDownList that particpates in an Address View Model. Is it best to store the list of 170 or so countries in a database and load them into a collection on the View Model, or is it better to hard code them into the View Model as a…
Dr. Paul Jarvis
  • 256
  • 3
  • 15
0
votes
2 answers

Should WordPress Page Builders be avoided by competent hard coders?

Do WordPress Page Builders increase page load speed and as such, should these be avoided by those competent at hard coding? Or is there something else that I am missing as the only real value, I can see with Page Builders, is that they help reduce…
Craig
  • 1,872
  • 5
  • 23
  • 56
0
votes
1 answer

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…
JoezCodes
  • 157
  • 2
  • 15