I guess the assumption is that as developers refactor or change the code, they will update the documentation (because developers love writing documentation... right)
what's the method doing? the static suggests it's stateless, but there's not much stateless work you can do taking in a single int and returning a string
OK so it takes an svid int as param, makes a DB call to a proc, puts the results into a DataTable and then counts the rows, if more than 0 and is marked electronic ordering, it updates the file path string, then returns... or returns an empty string... which means, if the value in the table is marked as electronic, but the row has no value for filepath field... KABOOM
I'm working on some code right now where the goal is to take in a byte stream and grab the data from the body of a message. The data is 10 bytes long and is meant to be translated into hex. Specifically, the 10 bytes coming in look like 01000200030004000500 or 01010201030104010501 (with implied 0...
I've taken some suggestions from
PHP Form Builder Class
and tried to build my own FormBuilder class.
Its supposed to work like this:
a) Creates an object of type form
b) attaches objects of type FormElement to form
c) FormElements are aggregates of Rules and InputTypes
d) Rules: define...
@Vogel612 So what my algorithm now does is it first generates the simplest queue possible (if your goal is Metal Mine 10 it puts 10 metal mines in a row with metal and crystal storages if necessary)
Then for all buildings on all positions in the queue it tries to add that building, computes the time, stores the one that generates the least time: It uses that building, and goes on to the next iteration until no further improvement is detected
A variant on that is that it generates all (building, building) pairs on all possible (position, position) pairs to insert two buildings at once
It also works with building^3 triples on position^3 triples, but performance of that is... non-existant
Now the old version gives this output pastebin.com/0jTdijAq and the new version (with storages) gives this output pastebin.com/gFL5fD7Y (it may be a bit difficult to read though)
Though lookahead-2 might be most interesting as only there it clan plan a robotics factory as individually planning a robotics factory is pointless as there is no deut production and planning a deut mine is pointless as there is no deut consumption, so you have to plan them at the same point
I wonder if I should divide this class into two , since it contains two " ifs " with different messages . To break it would be in keeping with the " S" SOLID ? It would be usual or a waste of time ?
internal class ValidDateApuration : IBusineeOfValidation
{
public MessageValidation Validar(D...
I am currently working on a word search program for my java class, and i thought i would do some research on other similar programs before i got started (see how they work before i write my own version). i stumbled accrossed this program :Java Word Search Solver
it looks very well written, but ...
I have a slice with ~2.1 million log message strings in it that I am parsing for regular expression matches. For any matches, I add it to a local slice and then return said slice.
func Search(re *regexp.Regexp, logs []string) []string {
var lwg sync.WaitGroup
var lresults = make([]string, 0)
Num...
Im making a project that encrypt a message and decrypt by the receiver. the program is completely running in the emulator but when I run it in my phone and send an encrypted message,the program will just finish and no SMS was sent
public class EncDecSMSActivity extends AppCompatActivity {
/** Ca...
I've been tasked with storing and retrieving images from the database. I've gotten it to work using a post back but that doesn't flow with the rest of the site. Is there a way to rewrite this code in order not to post back? Not terrible difficult but not efficient and also uses the post back.
...
So I'm trying to write a programme to find chen primes. For those who don't know a chen prime number is a prime number where when the prime number = p, (p + 2) is either also a prime number or has two prime factors. I think I've got it working and certainly the first few values are correct but I...
I'm voting to close this question as off-topic because it's a request for code review. — PiotrWolkowski14 secs ago
If you decide to post on Code Review, please be sure to provide a self-contained code sample, not just snippets. Also, please explain more precisely what your inputs are and what outputs you expect. Actually, doing this would be good for Stack Overflow as well. Also, if you ask on Code Review, please delete the question here since cross-posting is frowned upon. — 5gon12eder9 secs ago
@CaptainObvious Some programmers tend to express more self-doubt than others. I think it's a bad idea to be reflexively hostile to questions that express those doubts.
Finally found the issue I've been tracking down all day... one tiny little trailing space in a worker's first name that trickled all the way down to the EDI and caused a failure on the vendor's end... all because the user inputs were not trimmed before inserting in the table.
@Phrancis I hate those. I've got a function in my Standard Methods collection purely for taking strings and removing every single damned non-display character
@Zak Agreed. I set up a cleanup SQL job today to run each morning in production now and fix those, in the interim to the actual code fixes being deployed
@Phrancis I would not worry because they were not trimming the input, I would worry because the a trailing space caused an EDI failure, is that normal?
@Phrancis Be ready for the day that an user creates a bug that they cannot use names starting with a whitespace as workaround to hide them from other systems anymore :D
I believe this is a good question for the Code Review stack exchange site because you have working code and are just looking to improve performance. I would suggest removing this question and posting it there instead — Kevin Wells15 secs ago
@Caridorc There is also a known defect on the vendor's end when they parse the XML files the EDI sends where it parses a field is formatted like <Clinician>FIRSTNAME LASTNAME, RN</Clinician> which right now looks for exactly one space between the names, but in these cases it had two spaces so it thought that the last name was empty
I am trying to get this spider to go to the www.newslookup.com/Business and first extract the date/time item['time'] the item ['source'] and then go into the article link and get the url and name.
I believe I am getting an error from the request.meta section as I get the following error:
2016-0...
i am using a (D/ drive) to hold my R programs and files. I have installed rjava however i have tried all commands to try and run it however it keeps saying it cannot find the path.
The java file is stored in a example like "D: work" what commands would i use in the R command to get it so it will...
I am trying to solve a problem in hacker rank and the question is as follows
Jesse loves cookies. He wants the sweetness of all his cookies to be greater than value K. To do this, Jesse repeatedly mixes two cookies with the least sweetness. He creates a special combined cookie with:
sweetness =...
I created this snippet to "split" my full-album videos into its individual songs without the need of actually splitting the video file.
I personally created this snippet because I enjoy reading all musics from a directory in shuffle mode and stumbling upon a full album kinda ruins the point.
#!...
Yes, a sorted TStringList would probably be better, and depending on the version of Delphi there are probably even better alternative. This code has many issues with style, at least. You should probably post it over on code review. One thing: You set HostID to the result of CompareText - is that right? — 500 - Internal Server Error7 secs ago
I am a high school student in Computer Science 2 coding a pong game. I need to create a lag of 3 seconds before the ball begins to move. I have an update method as well as a run() method, and I think doing this would use those two? Please help me implement this!