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
1
vote
0 answers

External PGS subtitle(.SUP) track burned with FFMpeg is out of sync

Here is the scenario. I have 2160p(HDR) files of one series with the SUP subtitles I want, and 1080p files of that series. I want to burn the SUP subtitle onto the 1080p files in hardcoded style. The files in folder '1' is the 1080p files which I…
WongYon
  • 11
  • 3
1
vote
1 answer

Hardcode a data frame in R

I have a data.frame object, for example the data set 'iris'. I would like to have in the script something like: Sepal.Length_2 <- c(5.1, 4.9, 4.7, 4.6, ...) Sepal.Width_2 <- c(3.5, 3.0, 3.2, 3.1, ...) Petal.Length_2 <- c(1.4, 1.4, 1.3, 1.5,…
Miquel
  • 442
  • 3
  • 14
1
vote
1 answer

How to get current name of route(such as 'this' value)in Vuejs?

I am a newbie of vueJS and I would like to use the following template to start my project and I would like to convert it work with IE11 Link : codepen erickarbe/pen/pLbRqQ The original code is: computed: { filteredMembers() { return…
MaryAnn
  • 95
  • 1
  • 8
1
vote
0 answers

Python: How to write a generic script and avoid hardcoding strings?

I need help framing a generic script that helps avoid the following kind of hard coding of strings. Thanks in advance! df['Visual Labels'] = df['Visual Labels'].apply(lambda x: ','.join(map(str, x))) df['CONTAINS_CATEGORY'] =…
1
vote
2 answers

iOS hardcode user location

I would like to introduce a specific user location by code. I only need to hardcode the userlocation to make an screenshot for the appStore. Could somebody help me? Thankyou!
ValentiGoClimb
  • 750
  • 3
  • 13
  • 23
1
vote
1 answer

How to hard code BLE pairing passkey in bluez 5.x peripheral?

I need to have a hard coded passkey pin (eg "123456") in my peripheral device so that android mobile will have to enter this code while pairing. I am using ubuntu 18.04, bluez 5.48 and a TI BLE4.0 + wifi chip on board. Currently, I am able to…
1
vote
2 answers

How to hardcode .cer certificate in Objective-C?

I have been trying to implement SSL Pinning for a hybrid app using a plugin which builds the native code for the required functionality. Inside the generated native project, the Objective-C code includes the following function to read certificate…
Thilina Ashen Gamage
  • 1,367
  • 1
  • 12
  • 21
1
vote
2 answers

Change hardcoded values in python 3

I would like to change hardcoded values in my code. I would like the code to replace and change hardcoded values based on the number of times it runs. Beginning with: x=1 The next time, after I run it, in the code itself, I would like to see in the…
Durian Jaykin
  • 127
  • 1
  • 9
1
vote
1 answer

how do i go about doing this file path?

I made an app that i'm am working on updates for and in the old version I hard coded the file path like this "/data/data/my.app.here/troll" so now I am trying to do an update and I am trying to use something similar to Context.getFilesDir() but…
JRowan
  • 6,824
  • 8
  • 40
  • 59
1
vote
0 answers

Are good practices regarding usage of hardcoded strings different for Javascript

I recently started learning and using JavaScript with Node.js. One of the things I noted, in different tutorials and also in production code, is that there are lots of hardcoded strings. For example:…
Anorflame
  • 376
  • 3
  • 12
1
vote
1 answer

Django better way to filter dates without hard coding in the view

In a django view I am filter out the content for each year to display it in a chart via a template. Currently I am doing the calculation for each year manual, but there has to be a better way to right the code so that it just filters the content by…
tim
  • 917
  • 3
  • 14
  • 24
1
vote
2 answers

call printf() editing the executable

I'm trying to "crack" a console program, forcing it to display something. The problem is I can't print a newline (\r\n). With a disassebler I found the place and edited the binary: push 4ad0eb46 ; the string (let's pretend "Hi…
BlackBear
  • 22,411
  • 10
  • 48
  • 86
1
vote
0 answers

Is it a good idea to Hardcode something like a ListView/RecyclerView in android?

I want something like a ListView/RecyclerView with cards, all the text and image are available locally. Considering all this, is it a good idea to Hardcode the layout with cards and setting text and images in XML only?
1
vote
3 answers

How to prevent hardcoding when reading from txt-file to 3 different lists - python

I am creating a code in which it reads information from a txt-file and stores the information on three separate lists. The code I have created does this, but in a pretty hardcoded manner. My question is if there is any better way to read from the…
Jurkka
  • 61
  • 5
1
vote
1 answer

Use of FirebaseAuth credentials in an Android .apk

I'm currently looking at an .apk for Android and I came across some hard-coded credentials (email address and password). Apparently these are used for something called FirebaseAuth, which seems to be a Google service. I'm not very familiar with the…
1 2
3
10 11