Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Charlie Brumbaugh
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #282203 |
@Culyx because joining to a concatenated field of 5 columns is faster than to the 5 columns one at a time. (more) |
— | over 3 years ago |
Edit | Post #282203 | Initial revision | — | over 3 years ago |
Question | — |
How to create a MySQL generated column that uses a join in a concat? I have a column that is a concatenation of 5 other columns plus a join to a different table. UPDATE db.a JOIN db.b ON fkb = b.pk SET concatfield = CONCAT(field1,field2,field3,b.field,field4,field5) What I would like to do is set the ``concatfield`` to a generated column, co... (more) |
— | over 3 years ago |
Edit | Post #280843 | Initial revision | — | almost 4 years ago |
Question | — |
Is it possible to disable the "mysql: [Warning] Using a password on the command line interface can be insecure" warning? For my purposes, it is secure enough to use passwords to execute MySQL commands on the command line, what I would like to do is disable the warning that says, `mysql: [Warning] Using a password on the command line interface can be insecure` because that warning distracts from more pertinent err... (more) |
— | almost 4 years ago |
Edit | Post #280699 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Is it wrong to demand features in open-source projects? It is not wrong to ask for changes or features or report problems, so long as you realize that the maintainer of the project is under no obligation to make those changes. You aren't paying them, so you can't tell them what to do. Asking you to make those changes instead of them, plays by the same rul... (more) |
— | almost 4 years ago |
Edit | Post #279634 | Initial revision | — | about 4 years ago |
Question | — |
What are the pros and cons of using objects vs associative arrays for JSON results of a CURL request in PHP? I have a PHP script that uses CURL to return a JSON result that looks ``` //Curl set up code $result = curlexec($ch); //Error checking code $json = jsondecode($result, true); //Code to process result. ``` Now with the `jsondecode` function, I could set it to return process the JSON into a ... (more) |
— | about 4 years ago |
Edit | Post #279304 | Initial revision | — | about 4 years ago |
Answer | — |
A: How can I make --reset-author the default? You should be able to alias the string to something short. For example, I have ``` git config --global alias.a 'add .' git config --global alias.ci commit ``` and so instead of ``` git add . git commit -m'Message' ``` I can do ``` git a git ci -m'Message' ``` In your case, ... (more) |
— | about 4 years ago |
Edit | Post #279168 | Initial revision | — | about 4 years ago |
Question | — |
Multiple code blocks have the code in different colors On this question https://software.codidact.com/questions/279097 there are two code blocks, but the color of the text is different. Image alt text I directly copied and pasted the code so I don't see why some of the code would be red in the second block and not the first. Is this a bug in how... (more) |
— | about 4 years ago |
Edit | Post #279149 | Initial revision | — | about 4 years ago |
Question | — |
In PHP what is the use case for include instead of require when including PHP scripts? In PHP one can either use `include` or `require` to include files, the difference is that if the file doesn't exist it will emit a fatal error and halt with a `require` and only emit a warning with `include`. Normally would rather my code fail if code is missing and require that it be fixed rather... (more) |
— | about 4 years ago |
Edit | Post #279144 | Initial revision | — | about 4 years ago |
Question | — |
Is there a way to automatically fix MySQL tables where the auto_increment has fallen behind the correct value? Due to a series of unfortunate events I have some tables where the autoincrement value got behind what it should be. If the autoincrement value is 9 and there are 20 rows in the table the next 11 INSERTs will fail because the primary key value already exists. It's possible to fix this manually... (more) |
— | about 4 years ago |
Comment | Post #279113 |
So this way will lock up the DB for a while, and avoiding the locks is the whole point of using PHP and doing it in sections (more) |
— | about 4 years ago |
Edit | Post #279102 |
Post edited: |
— | about 4 years ago |
Edit | Post #279102 | Initial revision | — | about 4 years ago |
Question | — |
In MySQL is there a limit to the number of keys in a IN() clause? I have a PHP program that does a SELECT and then updates some of the values based on an algorithm. Rather than updating one row at a time ``` UPDATE exampletable SET COLUMNA = 1 WHERE primarykeycolumn = 10; ``` I was thinking of doing many updates at once like ``` UPDATE exampletable S... (more) |
— | about 4 years ago |
Edit | Post #279097 |
Post edited: |
— | about 4 years ago |
Edit | Post #279097 | Initial revision | — | about 4 years ago |
Question | — |
Are there best practices for sticking conditions in WHERE clauses vs the JOIN statement? Lets say I have two tables, A and B and I need to join a subset of them. Is there best practices of sticking the conditions in the WHERE clause like this, ```sql SELECT FROM A JOIN B on a.fkb = b.pk WHERE a.pk <10000 ``` versus sticking the condition in the JOIN like this, ```sql S... (more) |
— | about 4 years ago |
Edit | Post #279089 |
Post edited: |
— | about 4 years ago |
Edit | Post #279089 | Initial revision | — | about 4 years ago |
Question | — |
Iterating through a MySQL table with a LIMIT clause and PHP gets progressively slower I have a very large table that I need to iterate through with a PHP script and I can't do all of the results at once so I do it in sections with a LIMIT like ``` for ($x = 0; $x results($sql); //Do stuff with results } ``` At first the select returns the data very quickly but as time goes... (more) |
— | about 4 years ago |
Comment | Post #279035 |
Each column had a unique key, not a unique key on the combination (more) |
— | about 4 years ago |
Edit | Post #279034 |
Post edited: |
— | about 4 years ago |
Edit | Post #279034 | Initial revision | — | about 4 years ago |
Question | — |
Why would an unique index get moved to the primary key after the underlying column is dropped? So I had a table with a primary key and a bunch of different columns. Columns A, B, and C were all unsigned ints (like the primary key column) and each column had a unique constraint I dropped the A, B, and C columns, and then I got a warning that there were now duplicate unique constraints. When ... (more) |
— | about 4 years ago |
Edit | Post #279024 |
Post edited: |
— | about 4 years ago |
Edit | Post #279024 | Initial revision | — | about 4 years ago |
Answer | — |
A: How to drop all stored procedures from a MySQL database The easy way is to run this query. ``` SELECT concat('DROP PROCEDURE IF EXISTS exampledatabase.',routinename ,';') FROM INFORMATIONSCHEMA.Routines WHERE ROUTINESCHEMA = 'exampledatabase'; ``` For each stored procedure the above select will return a line like, ``` DROP PROCEDURE IF EXIS... (more) |
— | about 4 years ago |
Edit | Post #279023 | Initial revision | — | about 4 years ago |
Question | — |
How to drop all stored procedures from a MySQL database I need to drop all of the stored procedures from my MySQL database before I recreate them. How can I do so? (more) |
— | about 4 years ago |
Edit | Post #278992 | Initial revision | — | about 4 years ago |
Question | — |
Is it possible in MySQL to require each row in a table have at least one foreign key record in a join table? I have tables A and B and then I have a many to many join table with foreign keys to both called ab. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique. In the business logic for the program, every record in the A table must have a relationship to at le... (more) |
— | about 4 years ago |
Edit | Post #278985 | Initial revision | — | about 4 years ago |
Question | — |
What is the point of tagging a question with both a parent and a child tag? On the old sites, if you wanted to tag something with [sql] and [mysql] that required two tags. However, because we have hierarchal tags where [mysql] is a child of [sql] you only need to tag it with [mysql] to have it come up in the search for the [sql] tag. I am wondering what the use case here ... (more) |
— | about 4 years ago |
Edit | Post #278978 | Initial revision | — | about 4 years ago |
Question | — |
How much memory is allocated for a MySQL VARCHAR variable in a stored procedure? In a stored procedure let's say I have a VARCHAR variable, ``` DECLARE examplevariable VARCHAR(100); ``` how much memory is allocated to it and is that independent of the length of the data in the variable? The reason I ask is that I had a stored procedure that would run out of memory until ... (more) |
— | about 4 years ago |
Comment | Post #278899 |
@Alexei my point being that leaving this open if the command was in a bash script and closing it if just running from the command line seems very arbitrary. If I add "In my bash script " to the front of the question, does that make it on-topic? (more) |
— | about 4 years ago |
Comment | Post #278899 |
@Alexei Would using a zip program in a PHP script to archive folders after downloading data from a DB be on topic? In other words does the OP just need the right context to ask the question? (more) |
— | about 4 years ago |
Comment | Post #278837 |
Is that a ```goto``` ಠ_ಠ ? (more) |
— | about 4 years ago |
Edit | Post #278804 | Initial revision | — | about 4 years ago |
Question | — |
For scripting what are the pros and cons of command line arguments versus capturing input at the start? Let's say I have a script that needs the user to set X number of variables at the start. One can either - Pass the arguments in on the command line. - Start the program and then have the user input the variables with Python's ```input()``` function or PHP's ```fopen("php://stdin", "r")``` for e... (more) |
— | about 4 years ago |
Edit | Post #278800 | Initial revision | — | about 4 years ago |
Question | — |
PHP script to create a KML square centred on a point. The objective here is to create a set of square kml coordinates centered on a point. I use this to create a square map centered on a mountain peak and then turn that into a STL that I can 3D print. ``` "; $drad = $meter / 6378137; $i = 45; for ($loop = 0; $loop \n"; echo $kml; ``` (more) |
— | about 4 years ago |
Edit | Post #278767 |
Post edited: |
— | about 4 years ago |