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

What is a good way to make a classified ad website?

I am undecided whether to use a Content Manangement System ( wordpress, drupal, joomla ) to build my own classified ads website like olx.com or craiglsit. Is it good to make a it using a CMS Or should I just hard code it on my own? assuming I have…
Rc Cnls
  • 3
  • 3
0
votes
3 answers

Calculating 2 weeks for every week SQL

I'm still new to SQL so this question I am asking may be easy for you. So I am creating a report that for every week generates the prior 14 days (Or 2 weeks) of the funded contracts. I know this has to be Hardcoded to a specific company. The ID for…
0
votes
1 answer

Techniques for avoiding dataset path hardcoding

I have some shared projects that are under version control (concretely svn and bazaar, but I'm seeking for a general solution), but the datasets the projects use are not (too big and shared by different projects). In the source code I need to…
Alessandro S.
  • 875
  • 12
  • 24
0
votes
1 answer

How to hardcode row in Select statement?

Select 0 AS A, 1 AS B FROM someTable Based on the above query, I can hardcode the number of column and the data regardless of what data is in someTable, and the number of rows is depending on the number of row in someTable. I'm wondering what can I…
SuicideSheep
  • 5,260
  • 19
  • 64
  • 117
0
votes
1 answer

Sending hardcoded email with attachment

I am trying to write a code for sending hard coded email with attachment i-e I don't want to use the buttons and text fields. I want when the program runs it should automatically go to location in my drive and attach some files and email it to the…
0
votes
1 answer

Using one vbscript to change a hard-coded date in another vbscript

I'm working with two related VBscripts right now. The first file calls the second file to perform tasks. In the second file, I'm constructing several address to create new folders and copy files over. However, the "year" value is hard-coded. Thus I…
0
votes
1 answer

Java, XML: extending methods... and JDOM to construct applications in a flexible way?

As a learning experiment i have been working on creating a 2d java game using LibGDX. I have a REALLY big problem with hardcoding but iv never been able to do anything about it. until recently when i (finally) figured out how to use sax/dom…
0
votes
0 answers

How do I hardcode a dynamic url to an image map?

I am working on a Zip Code search, and have successfully built the search. Now, I need to have the ability to click on an image map of a map, and hardcode an href to a dynamic URL So for example, the search works well displaying contact information…
GWana
  • 3
  • 2
0
votes
2 answers

iOS - Hard Code value in selector for UIButton action

I want to hard code a value inside the @selector of a UIButton's action. When adding a value inside the @selector I get an error saying: This is how you normally add a @selector to a UIButton: [myButton addTarget:self…
Aleksander Azizi
  • 9,829
  • 9
  • 59
  • 87
0
votes
2 answers

How to integrate (hardcode) a font file into my program?

I'm currently hardcoding my images into my C++ program as a struct (the source code with the pixel data can be created with GIMP), like so: static const struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; …
Joelle Denby
  • 13
  • 1
  • 3
0
votes
1 answer

"Hardcode" passed variables from JQuery/Javascript into a PHP file

I am creating an E-mail Reporting System to send scheduled e-mails (daily, weekly, etc.) with the results of certain SQL queries. I have one HTML & JQuery page, generate.html, containing a form which allows a user to customize the report. The form…
Alex
  • 85
  • 1
  • 7
0
votes
0 answers

Eclipse plugin for hardcoded text in Android

Is there any plugin for Eclipse (like in IntelliJ) for extracting all hard-coded strings into strings.xml file?
Kamil Lelonek
  • 14,592
  • 14
  • 66
  • 90
0
votes
3 answers

Dictionary: hard-coded vs. external file

I have a java application which is started and stopped multiple times per second over hundreds of millions of items (called from an external script). Input: String key Output: int value The purpose of this application is to look for a certain key…
ATN
  • 665
  • 8
  • 26
0
votes
1 answer

Hard Coding Depth First Search Results (or Optimizing?)

I need to get all possible paths of a tree so I implemented a DFS like this: void bisearch(std::vector path, int steps, int node, std::vector> *paths) { int sum = 0; if (path.size() == steps) { …
user2183336
  • 706
  • 8
  • 19
0
votes
2 answers

Is there a better way to compute the top of the hour code for repeat interval notification?

I have hard coded this Hour to help me fire the local notification at the top of each hour, but something is wrong. Though, I dunno if it's the way I'm testing it, my Xcode behaviour, or the code itself. Anyway, here is the code I made, have a look…
user1949873
  • 460
  • 7
  • 17