Sunday, 29 May 2016
Originally posted from https://redd.it/4lleac via /r/programming http://ift.tt/1qV23GR https://redd.it/4lleac
Saturday, 28 May 2016
Wednesday, 25 May 2016
Question posted on stackexchange:
Basically it's the n number of bytes from one place to some other place in the file.
This could actually mean different things for different file formats:
Eg, the offset of the data after the beginning of the section header, Or, the offset from of that section from the beginning of the file, Etc...etc....
You're going to have to check the spec for the file format that you're using.
Tuesday, 24 May 2016
Thanks to Audible.com for supporting this video: http://ift.tt/1bipFvv Original video collaboration with Vsauce: https://www.youtube.com/watch?v=jN-FfJKgis8 Thanks to everyone who supports MinutePhysics on Patreon! http://ift.tt/1pJQhzm Link to Patreon supporters here: http://ift.tt/1Qg9p23 Music by Nathaniel Schroeder, http://ift.tt/VoBoRB REFERENCES Gravity & Spherical Shells: http://ift.tt/1XMHOZ5 More Shell Theorem: http://ift.tt/1mH3voC Density inside the earth (Preliminary Reference Earth Model): http://ift.tt/1XMI2zq Gravitational acceleration inside the earth: http://ift.tt/1U8VEC6 MinutePhysics is on Google+ - http://bit.ly/qzEwc6 And facebook - http://ift.tt/r3NJ0W And twitter - @minutephysics Minute Physics provides an energetic and entertaining view of old and new problems in physics -- all in a minute! Created by Henry Reich
Liked on YouTube: http://youtu.be/urQCmMiHKQk
Saturday, 21 May 2016
Question posted on stackexchange:
This question comes to my mind having just lost some money while ordering Pizza. Most internet merchants (atleast in India) use synchronous page redirection for integration with Banks and payment gateways.
It works like this: when you visit a merchant site and checkout something it redirects you to the payment gateway passing along request as arguments in a POST or GET request, which redirects you to the bank, which redirects you to verified by Visa and then redirections all the way back.
The problem is that often the redirection would fail or break due to a network error, slow connection, domain blocked by company firewall etc and the payment would get lost.
Off the top of my head, such integrations would be much better handled using an asynchronous MOM provider. Example: the merchant places a payment request message signed with his private key on Bank's MOM queue and asks the user to authorize the payment with his bank. The user opens Bank's mobile app or website and sees the request in list of pending payment requests. Once authorized the Bank places a message back on Merchant's MOM queue and all is done.
From my primitive google-fu it seems not many payment gateways are providing asynchronous integration.
Am I missing a web design principal here or is just mass incompetence? Why don't more gateways use an asynchronous approach?
The sort answer is 'history'.
If you go back even just 10 years, banks only did payments at physical devices, terminals. Where you would have one terminal id per payment device. All transactions needed to supply this terminal id. Obviously, you couldn't leave the shop with your goods until you had successfully paid. Hence the synchronous nature of payments. The key thing here is a merchant can only use one terminal id at a time.
Then the internet came along and merchant said "why can we not just do payments online?". So, the banks said, OK, send along everything you normally would, just flagged slightly differently (so we can charge you more). This bank message includes the terminal id. Therefore internet transactions inherited the synchronous nature of card present transactions.
Then add on top fraud protection devices such as 3DS and CV2AVS, and changing becomes really difficult for the poor old banks.
You will find newer banks will implement asynchronous payment methods which 'may' be a better model. But then you'll be fighting with two forces.
- Merchants saying, why do I have to change my payment model when moving from 'old bank' to 'cool bank'.
- Customers saying "I've bought a pizza, but I'm scared because it did something I wasn't expecting and I don't know if I paid".
You cannot underestimate either of these effects. We're therefore left with majority of synchronous payment models throughout the internet.
Don't jump straight on the ''incompetent'' camp, since it much easier to design how a perfect world would work when we don't have a real world to deal with.
Hope this helps.
Wednesday, 18 May 2016
Stop doing things you hate. Find your path and do what you want to do in life. Subscribe to my channel: http://bit.ly/1XTHlSF Support me on Patreon and get the full vlog, enter the give-a-ways, get behind the scenes access and early viewing to project videos: http://ift.tt/1csUWhL Get my book on Amazon: http://amzn.to/1NxeiED PROJECTS, PLANS AND TUTORIALS http://ift.tt/1RrsVsi Learn more about my shop and the tools I use: https://goo.gl/KaDZ10 Want to help support MAKE SOMETHING? Get early viewing, a weekly exclusive vlog and more... http://ift.tt/1Rz7Zwj SHIRTS, STICKERS, PLANS AND MORE! http://ift.tt/1RrsUEK FOLLOW: https://twitter.com/drunkenwood http://ift.tt/1Rz7Ys8 http://ift.tt/1YVDPcB http://ift.tt/1ZS3Cls David Picciuto PO Box 2499 Toledo, OH 43606 © Picciuto, LTD
Liked on YouTube: http://youtu.be/BicvXT2eGMk
Question posted on stackexchange:
I learnt about the check testing framework today that seems good. This far I've scripted tests that uses valgrind so that the tests both display output from the tests and from valgrind. Is there a disadvantage in using many test frameworks like valgrind testing for internal memory management, check testing for unit tests and scripts for integration and regression tests? I didn't begin yet writing tests with check and if you know a good/"better" framework for testing C code then please let me know.
This is how my test looks like so far, a script that tests my command-line program including output from valgrind.
If I already can do this with a script, will I even need the check testing framework?
Your certainly on the right track. For my projects I use:
"check" to unit test all method (including as many code paths as I can - have time for). This runs super fast and gives me confidence that the parts of my application are doing what I expect.
"Valgrind" to check the memory usage of the final application while running system/regression tests. This is really really slow, but give me confidence that my application has the desired functionality and the interactions between the methods that make up the application are not causing any unforeseen memory management issues.
So, my advice - do both. Good luck.