i am a master at doing only the first part! as soon as i try to refactor... someone brings me some other fire. its rare that i get to feel happy with the code i did.
Max Santos
Posts
-
My dirty little coding secret -
Question on performance...I would implement a tmp table with a twist: diff I would create a table, lets call it "ImportData" with 3 columns: ID: i assume there is a field on the CSV that is unique Data: the complete CVS line Status: a importa status depending on the operation I like char instead of int with "magical numbers" for these kinds os status A single char will not hurt performance Then: 1: Set the status to '?' before importing 2: Import to this table row by row 3: Have a SQL trigger that compares the value of column 'Data' If it changed, set Status to 'U' (Updated) if did not change set status to 'N' (NOP, No operation) 4: At the end, set all rows with '?' to 'D' (Deleted), these are the rows not present on the CSV 5: Process all rows with status different from 'N' (the changed ones) If 'U', insert or update on main table, if 'D' delete from main table This will give you a differential update with only the changed rows being updated in your Main data table. Will also give you a 'snapshot' of all data received in the last CSV file. Very useful for debug I have several imports done this way, usually imports are very fast since (in my case) most CSV rows do not change. If the import data is XML, o JSON you can do the same by saving the XML node or JSON node on the 'Data' column.
-
Rewrite or...?I don't think you will find a "silver-bullet-answer". It depends on the application, but mostly it depends on how well will the business that uses the app handle missed implementations. Old apps like that have the habit of getting small hidden gems that we gloss over during rewrite for one reason or another. Then we realize... "Ohhh so that is what that code was for!" If the application allows, i'm partial to the use of [^] If done right, both can coexist, and you can port an old piece into the new code bit by bit. The way it works is, you make a request for a url, if that URL is routed on the new app thats what gets served, if that url is not routed on the new one, YARP will fetch from the old and serve.
-
... If Internet goes down ...Oh come on... recent poll about "what do you do if internet goes down at work" is missing ALL real options - Start troubleshooting - Place phone out of hook to avoid out of breath users - Turn off mobile phone to avoid out of breath bosses - Wait until ISP solves it - Wait until fiber gets replaced - Wait until fiber gets replaced after killing rats
-
I hate linux. I hate SSL more.Ahh. OK. I have only one certbot in a Raspberry PI at home but is running as a service/daemon. I do not remember what i done, but it keeps renewing the cert by it self. Nothing gets added or removed from that PI, so it not a good comparison. But i find strange (a lot) that webserver has to stop to renew the cert. Renewing many sites takes a lot of time and no way the downtime is acceptable. Don't know what it is, but something is up.
-
I hate linux. I hate SSL more.I have 3000+ domains on IISs behind multiple HAProxyeis and NGinxs. One Windows VM is responsible for the creations and renewal of all certs on all Proxies using custom C#. (Keeps the date of last renew, renews, saves on proxy via SFTP, reloads proxy via SSH) A certificate is renewed every 60 days, if it fails i get warned and have 30 days to solve the problem. It never fails on LetsEncrypt, it is always because the Domain DNSs are wrong or something like that. Commercial/Adminstrative people add or remove clients (domains) at will and i never have to handle any of that. I absolutely love LetsEncrypt. No way i would renew 3000 domains manually. Tip: Don't stop NGinx, just reload it. (i assume certbot will not complain) If something fails on the renew, the site is still up with the old cert.
-
No REST for the wearyI find REST to be carp... but i'm in the minority... so i have to use it :( I once wrote something, but did not focus on latency. Its a good point that i had not considered. GitHub - maxsnts/TARAPI-An-API-Rant: “TARAPI” An API Rant![^] (I end up not finish the Rant because by that point i had released some steam. There's even lots of spelling mistakes)
-
Screenshots vs text...if the machine has no internet and cant send email whats the point of the copy button since they can not paste it into the mail?
-
Biblical Love take 2...What are you doing here?
-
I knew there must be a reason...Yeah, you right but having a good meat with a good red wine, and after a coffe and a good whiskey. what can beat that? :D
-
I knew there must be a reason...OK, some misunderstanding here... when i said "combo" i did not meant to mix them up :D That would ruin both of them. Much like whiskey-cola X| I was trying (unsuccessful i guess :d) to pass a the idea having them separated.
-
I knew there must be a reason...The first... :laugh:
-
I knew there must be a reason...By the way... what about whiskey? Anything good? maybe i would be able to make a combo!
-
I knew there must be a reason...Haaahhh glad to hear this!! Now i have an excuse :D
-
Windows 3.11I guess it depends on the person. For me its not about having a "blast from the past" but rather to experiment whatever i want. In my case VirtualBox rule.
-
Why this week rocked!Don´t you find Fruit and Vegetables from the stores really poor on flavor? I thing the way the economy is going... we will soon need to start to grow our own stuff. Anywho, nectarine are very fragile trees, if should place a small mesh around the base.
-
Windows 3.11Why not use a Virtual Machine?
-
Anti-rant: Office 2010.Hey, what the point of having new things if you cant use them :D
-
Php vs .NETThats right, after working with .Net no one wants to go back to php :d that why they get requested more
-
Anti-rant: Office 2010.Maybe that their way of solving the caption bar bugs, like the one where you can not just drag a maximized office window in windows 7, when all other applications work... that drives me insane