How do I measure request and response times at once using cURL?

From this brilliant blog post… https://blog.josephscott.org/2011/10/14/timing-details-with-curl/ cURL supports formatted output for the details of the request (see the cURL manpage for details, under -w, –write-out <format>). For our purposes we’ll focus just on the timing details that are provided. Times below are in seconds. Create a new file, curl-format.txt, and paste in: time_namelookup: %{time_namelookup}s\n time_connect: %{time_connect}s\n time_appconnect: %{time_appconnect}s\n time_pretransfer: … Read more

Could not load file or assembly ‘Microsoft.ReportViewer.WebForms’

This link gave me a clue that I didn’t install a required update (my problemed concerned version nr, v11.0.0.0) ReportViewer 2012 Update ‘Gotcha’ to be aware of I installed the update SQLServer2008R2SP2 I downloaded ReportViewer.msi, which required to have installed Microsoft® System CLR Types for Microsoft® SQL Server® 2012 (look halfway down the page for installer) In the GAC … Read more

Variable interpolation in the shell

Use or or _ is a valid character in identifiers. Dot is not, so the shell tried to interpolate $filepath_newstap. You can use set -u to make the shell exit with an error when you reference an undefined variable.

What is signed integer overflow?

Your while condition will always be true, meaning the loop will run forever, adding 1 to c in each iteration. Since c is a (signed) int it means it will increment slowly to its max value, and after that the next increment would be UB (undefined behavior). What many machines will do in this specific UB is to turn c negative, which I … Read more

mkdir c++ function

If you want to write cross-platform code, you can use boost::filesystem routines This does add a library dependency but chances are you are going to use other filesystem routines as well and boost::filesystem has some great interfaces for that. If you only need to make a new directory and if you are only going to use VS 2008, you … Read more

try catch ArrayIndexOutOfBoundsException?

I don’t see an array anywhere in your code, so that’s maybe why the try block isn’t catching anything (I assume there is an array in one of the called methods?). Also, you really, really shouldn’t allow your program to read outside the bounds of an array. That’s just bad design. That being said, here … Read more

PHP Unset Session Variable

You can unset session variable using: session_unset – Frees all session variables (It is equal to using: $_SESSION = array(); for older deprecated code) unset($_SESSION[‘Products’]); – Unset only Products index in session variable. (Remember: You have to use like a function, not as you used) session_destroy — Destroys all data registered to a session To know the difference between using session_unset and session_destroy, … Read more

RGBA code for red color

The range for red, green and blue is 0-255. The high the number, the more presence the color shows. The range for alpha is 0.0-1.0. The higher the number, the higher the opacity. Fully opaque red would be rgba(255, 0, 0, 1)