What are all the possible values for HTTP “Content-Type” header?

You can find every content type here: http://www.iana.org/assignments/media-types/media-types.xhtml The most common type are: Type applicationapplication/java-archive application/EDI-X12 application/EDIFACT application/javascript application/octet-stream application/ogg application/pdf application/xhtml+xml application/x-shockwave-flash application/json application/ld+json application/xml application/zip application/x-www-form-urlencoded Type audioaudio/mpeg audio/x-ms-wma audio/vnd.rn-realaudio audio/x-wav Type imageimage/gif image/jpeg image/png image/tiff image/vnd.microsoft.icon image/x-icon image/vnd.djvu image/svg+xml Type multipartmultipart/mixed multipart/alternative multipart/related (using by MHTML (HTML mail).) multipart/form-data Type texttext/css text/csv text/html … Read more

Cout and endl errors

The compiler needs to know where to find std::cout first. You just need to include the correct header file: I’d suggest you not to pollute the namespace using using directives. Instead either learn to prefix std classes/objects with std:: or use specific using directives:

Categories C++

angular.service vs angular.factory

I had trouble wrapping my head around this concept until I put it to myself this way: Service: the function that you write will be new-ed: Factory: the function (constructor) that you write will be invoked: What you do with that is up to you, but there are some useful patterns… Such as writing a service function to expose a public API: Or … Read more

Encode HTML entities in JavaScript

You can use regex to replace any character in a given unicode range with its html entity equivalent. The code would look something like this: This code will replace all characters in the given range (unicode 00A0 – 9999, as well as ampersand, greater & less than) with their html entity equivalents, which is simply &#nnn; where nnn is … Read more

Producing subscripts in R markdown

Since you mention Pandoc in your comments, maybe it’s not cheating to depend on Pandoc’s extensions for subscript and superscript. From here, we can create a minimal example Rmd file: Using Knitr results in an HTML file that renders like this: That clearly doesn’t work. But you can run pandoc on the resulting markdown file (which I’ve named “Subscripts.md”): … Read more

Categories r

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

Solution: Explanation: It will download all files and subfolders in ddd directory -r : recursively -np : not going to upper directories, like ccc/… -nH : not saving files to hostname folder –cut-dirs=3 : but saving it to ddd by omitting first 3 folders aaa, bbb, ccc -R index.html : excluding index.html files Reference: http://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/

Where is the variable “code” in SKError defined?

I am seeing examples of code using SKError “code” property or variable. I cannot seem to define any definition for this property. How is xcode / Swift able to access this property? I am using SwiftyStoreKit with this issue. Thanks Tried looking in the documentation for SKError, nothing there. Tried debugging in xcode, live, cannot … Read more