Reminder to self: for HttpWebRequest make sure you have your proxy setup correctly.
Monitoring HTTP Output with Fiddler in .NET HTTP Clients and WCF Proxies – Rick Strahl’s Web Log.
–jeroen
Posted by jpluimers on 2014/04/15
Reminder to self: for HttpWebRequest make sure you have your proxy setup correctly.
Monitoring HTTP Output with Fiddler in .NET HTTP Clients and WCF Proxies – Rick Strahl’s Web Log.
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Fiddler, Software Development, Visual Studio 11, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Web Development | Leave a Comment »
Posted by jpluimers on 2014/04/01
Sample: Cast Media Player for Streaming with DRM
https://github.com/googlecast/CastMediaPlayerStreamingDRM
Flow Diagrams for Senders and Receivers
To help you decide which Google Cast options are right for your app, we have updated the Google Cast SDK documentation with two flow diagrams:
via Leon Nicholls – Google+ – Flow Diagrams for Senders and Receivers To help you decide….
via Shawn Shen – Google+ – * Sample: Cast Media Player for Streaming with DRM* ….
Posted in Chromecast, Development, Google, HTML, HTML5, JavaScript/ECMAScript, Power User, Scripting, Software Development, Web Development | Leave a Comment »
Posted by jpluimers on 2014/03/31
Interesting article by Gerwin Sturm on EU Cookie Regulations vs. Google+ plugins.
It’s not just that the directive causes this nagging because “of course we can’t remember that users haven’t given us consent for storing cookies, because that would require storing a cookie, so the consent banner will always appear until the user has actually given consent.”
Some other valuable tips are in this article as well. Now go read it (:
–jeroen
Posted in Development, HTML, HTML5, Software Development, Web Development | Leave a Comment »
Posted by jpluimers on 2014/03/08
Even though 3 years old, this is still relevant. Thanks Ilya Grigorik for pointing me at it.
Make sure your HTML HEAD tag has the elements in the below order:
Why? Read Best Practice: Get your HEAD in order – IEInternals – Site Home – MSDN Blogs.
So the document element starts like this: Read the rest of this entry »
Posted in Development, HTML, HTML5, Software Development, Web Development | Tagged: HTML HEAD tag | Leave a Comment »
Posted by jpluimers on 2014/03/07
Funny charts at andrewvos.com – Amount of profanity in git commit messages per programming language.
The source is online too: AndrewVos/github-statistics.
And it led me to this really nice way of choosing your chart type.
Click to enlarge… Read the rest of this entry »
Posted in .NET, C#, C++, Development, Java, JavaScript/ECMAScript, Perl, PHP, Ruby, Scripting, Software Development, Web Development | 2 Comments »
Posted by jpluimers on 2014/02/20
Since the time that spaces are allowed in path and file names, it has caused confusion.
I personally like the readability of spaces, but still tend to avoid them as they usually cause more harm than the readability gains.
An interesting thread about spaces in file names is operating systems – What technical reasons exist for not using space characters in file names? – Super User.
In URLs, you there are various kinds of places where spaces can be used. You have to escape as Xah Lee wonders in does HTTP protocol require space be encoded in file path?.
The escaping is part of the URL Encoding, but the escapes depends on the position of the space. In the query part (after the first ?), you can have it escaped by both %20 and plus sign, but in the path part (before the first ? sign), it can only have a %20.
This is explained by bobince in urlencode – when to encode space to plus (+) and when to %20? – Stack Overflow.
That escaping basically makes path and file names a lot less readable when passed as a URL. It causes posts like these:
But why can you still use spaces when you type a URL in your web browser, or use it in a href, src or other HTML URL attribute?
Xah Lee rightfully earlier wondered about that in webserver – space in url; did browser got smarter or server? – Stack Overflow.
Technically, both are not allowed. But web browser manufacturers understand we humans are lazy, and accommodate for that by encoding these when putting them into the HTTP request.
You can type “https://www.google.com/search?q=foo bar” in your web browser, and depending on the browser, it gets translated into either one of these:
Recap:
–jeroen
via:
Posted in Development, Encoding, HTML, Software Development, URL Encoding, Web Development | Leave a Comment »
Posted by jpluimers on 2014/01/23
I wish I had found about Generate HTML Tables Clean and Fast years ago.
Every once in a while I want to generate the source code for an HTML table with some content easily.
I’ve found no tool doing this in an easy manner and starts in a split second.
But the web page Generate HTML Tables Clean and Fast does.
Correction: did. It is now off-line, but the Blended Technologies » Blog Archive blog posts about it are still online: Introducing TableGen – The HTML Table Generator and Tablegen Goes Open Source, as is the WayBack machine archive for it.
So I installed Python on my openSUSE server according to Embedding Python In Apache2 With mod_python (… OpenSUSE) | HowtoForge, (could as well have configured in httpd.conf in stead of python.conf: no difference between installing mod_python via httpd.conf and conf.d in apache) then installed the TableGen source there.
(Note: more python.conf examples)
That would still have Python generate a 404 error (uncool: a python generated 404 error does not leave a log of the cause anywhere), not because the index.py was absent, but because it was written in old style “print” statements, not using the new style def index(req); way (thanks Senthil Kumaran, and AJ. for your answer).
So I did some research (this was my first encounter with Python) at for instance Paul Osman : Introduction to mod_python, then rewrote the print parts of the script into string concatenations, then return the full HTML.
(Note: if there is a
print "Content-Type: text/html"(for instance demonstrated in Hello World | Web Python), you can omit it, or set the req.content_type likereq.content_type = 'text/html'which usually is determined automatically by Python).That caused quite a few IndentationError: expected an indented block quote errors: python is indentation sensitive (I hadn’t used a language depending on that for ages), and gives a confusing error when you have a colon (:) followed by an unindented docstring: Python: I’m getting an ‘indented block’ error on the last 3 quotes (“””).
Then it still didn’t completely work: the form parameters would not be obtained correctly, so I read further, found 3.1 A Quick Start with the Publisher Handler and started to fix that too. That took way too long, so I found out that “mod_python” is not very much maintained any more and “mod_wsgi” is the way to go.
So I disabled the “python” module in YaST2, removed “/etc/apache2/conf.d/python.conf”, then installed the “apache2-mod_wsgi” software package in YaST2, then added the “wsgi” module to HTTP Server Configuration list of Server Modules (it automatically gets enabled) and saved the configuration.
These steps modified the APACHE_MODULES in /etc/sysconfig/apache2, restarted apache with “rcapache2 restart”. You can verify with “httpd2 -M” which modules are loaded. The list should exclude “python_module (shared)” and includes “wsgi_module (shared)”.
Most of this is described in has anyone gotten mod_wsgi working.
Python is whitespace sensitive, but you can have multiple statements on one line. That’s why Python allows semicolons after each statement.
Read Setting up Python with WSGI on Apache for a directory – Stack Overflow.
Read PyCon Conference Slides – Sydney 2010 – Python WSGI adapter module for Apache.
Read Graham Dumpleton: Why are you using embedded mode of mod_wsgi?.
Read Serving Python scripts with Apache mod_wsgi, part I | Leave No Bit Unturned.
Read Parsing the Request – Get | Web Python.
Watch WSGI Tutorial. It explains a lot, including Accessing POST Data from WSGI.
Error “Attempt to invoke directory as WSGI application” -> you cannot do that, there is no way to map a directory to an “index.py” in that directory.
For importing .py files from the same directory as your main .py file:
import os import sys directory = os.path.dirname(__file__) sys.path.insert(0, directory) from webutils import *Start using The Web framework for perfectionists with deadlines | Django.
A few really cool things about this page:
Generating something like this was a breeze: Read the rest of this entry »
Posted in *nix, Apache2, Development, HTML, Linux, openSuSE, Power User, Software Development, SuSE Linux, Tumbleweed, Web Development | Leave a Comment »
Posted by jpluimers on 2013/12/25
StackOverflow user Joe (sorry, no last name) helped me big time by answering my question on Business logic shared by ASP.NET / WinForms: find the location of the assembly to access relative files to it.
Before showing the code at the bottom of this blog post, let me explain the question in more detail:
Basically I was in the midst of refactoring some ‘inherited’ business logic code that – before refactoring – for the ASP.NET side needs to be initialized with an absolute path, but on the WinForms / WPF side only with a relative path to a GetExecutingAssembly directory.
To ease xcopy deployment, I wanted all configuration settings to be relative. But I hadn’t found a common means for these platforms to obtain a directory usable as a root for accessing relative files.
That way I could put identical settings in both the Web.config and App.config, heck even generate them based on a common fragment, whithout having to hard-code absolute path names.
I knew about Assembly.GetExecutingAssembly, but in ASP.NET that location is not where the web site is (both IIS and the WebDevelopment server make use of temporary locations to store the assemblies).
ASP.NET does have Server.MapPath and HostingEnvironment.MapPath, but I didn’t want to make the business logic depend on ASP.NET.
Joe came up with this solution, which works dandy: Read the rest of this entry »
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, F#, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0, Web Development | Leave a Comment »
Posted by jpluimers on 2013/12/15
Funny how Generating complex math visualizations in SVG using C# and ILNumerics and MathViz (no, not this MathViz!) look so similar.
I hope the MathViz code becomes public one day.
–jeroen
via: Generating complex math visualizations in SVG using C# and ILNumerics – Scott Hanselman.
Posted in .NET, Delphi, Development, HTML, HTML5, iOS Development, Mobile Development, Software Development, Web Development | Leave a Comment »