The new version of Carbon for Android is out which features a number of changes including some quite striking visual differences to the original. My install was automatically upgraded to the new version yesterday and I must say that the interface is even more slick than the old one, but I have a number of issues with the new design.
1. The refresh icon rotation is off-centre.
I'm not quite sure why this has been done as it frankly looks a bit scrappy. Centering this would make the feature complete and professional.
2. A lot of space taken up by the 3 dots at the top.
Seriously, you could fit an entire line of text in the space occupied by those 3 little dots. Better use of that space could be made.
3. The font has a weird aspect ratio.
It is clear that you love this font but I find it much harder to read with its oddly vertically stretched aspect. It would be so welcome to have the option of a shorter font. This is practically a deal-breaker for me and the thing I can least understand as to why it has been forced.
4. No Tweet size of "small" ?
The menu option only starts at a size of "medium"; that's pretty weird.
5. Retweet mesages.
It's hard to tell immediately whether the message saying that something has been retweeted belongs to the tweet above or below the message. A hint of a border here would really help.
6. Bug - faded tweets.
Some tweets appear faded suddenly for no reason but then are fine when restarting Carbon.
I am so glad that I can now get to my own favourites at last, and the work on the profile view is pretty epic. Carbon itself is an amazing piece of software. But there are these few things that need to be addressed before I will be happy with the update, sorry guys.
Please note that if the font thing is addressed then I will definitely donate. I don't mean to hold to ransom but I feel pretty strongly about this issue.
Update: They fixed the font issue!
Thursday, 2 January 2014
Wednesday, 13 November 2013
Static Content in IIS 7.5
It's amazing how almost every piece of advice you read about something can be completely, utterly, totally useless. I think it's an endemic problem of developers who only spend time clicking the shiny buttons in the GUI of products without ever actually getting into the guts of a thing to see what is happening.
Anyway, a designer was trying to add .SVG, .ICO and .WOFF files to our website which worked fine locally but when viewed on our UAT server it was coming up with 404 errors for those files.
After a little head scratching, I found out that IIS disables transport for those extensions by default. When looking around for advice as to how to switch transport back on for these, I read so many articles where clearly the author never bothered to go near the web.config file.
And of the advice that did cover the web.config file, most of the received wisdom goes along the lines of:
Add these lines to the web.config:
<system.webServer>
...
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
</staticContent>
</system.webServer>
Which is great in theory, but this actually results massive amounts of errors on the site as it suddenly fails to load ALL STATIC CONTENT. So no CSS, JS, images, anything, plus a load of odd redirections for other types.
I figured that having these rules in a separate web.config file in our static resources folder might help, so I tried that and although the site was now generally working again, there were mysterious 500 errors for the .SVG etc requests.
After a little digging, I found this post on Stack Overflow:
http://stackoverflow.com/questions/13677458/asp-net-mvc-iis-7-5-500-internal-server-error-for-static-content-only/13677506#13677506
This saved me a complete metric fuck-tonne of time.
What all the advice I had read was missing is that you should remove the mappings in the static content before you add them, or you will get a 500 error that doesn't appear in any log unless you enable the really paranoid stuff in IIS.
So, the proper version of what the file looks like is this, remembering that this is a partial web.config sitting in our static resources folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".ico"/>
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
</staticContent>
</system.webServer>
</configuration>
Anyway, a designer was trying to add .SVG, .ICO and .WOFF files to our website which worked fine locally but when viewed on our UAT server it was coming up with 404 errors for those files.
After a little head scratching, I found out that IIS disables transport for those extensions by default. When looking around for advice as to how to switch transport back on for these, I read so many articles where clearly the author never bothered to go near the web.config file.
And of the advice that did cover the web.config file, most of the received wisdom goes along the lines of:
Add these lines to the web.config:
<system.webServer>
...
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
</staticContent>
</system.webServer>
I figured that having these rules in a separate web.config file in our static resources folder might help, so I tried that and although the site was now generally working again, there were mysterious 500 errors for the .SVG etc requests.
After a little digging, I found this post on Stack Overflow:
http://stackoverflow.com/questions/13677458/asp-net-mvc-iis-7-5-500-internal-server-error-for-static-content-only/13677506#13677506
This saved me a complete metric fuck-tonne of time.
What all the advice I had read was missing is that you should remove the mappings in the static content before you add them, or you will get a 500 error that doesn't appear in any log unless you enable the really paranoid stuff in IIS.
So, the proper version of what the file looks like is this, remembering that this is a partial web.config sitting in our static resources folder:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".ico"/>
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
</staticContent>
</system.webServer>
</configuration>
Labels:
.net,
ico,
iis,
iis7,
iis7.5,
mimemap,
really fucking awful advice,
stackoverflow,
static content,
svg,
woff
Antaris RazorEngine and Mono-3.2.3
After some machinations, I managed to get Antaris RazorEngine working with Mono-3.2.3.
After making and installing mono from a tarball (http://download.mono-project.com/sources/mono/), I took the latest version of RazorEngine down from github (https://github.com/Antaris/RazorEngine), compiled using mono's xbuild tool, and then took the version of RazorEngine.dll and System.Web.Razor.dll from the RazorEngine.Core folder and used that within my applications. I removed all instances of System.Web.Helpers, System.Web.Mvc, System.Web.WebPages, WebMatrix, etc as those would have conflicted references.
And RazorEngine is now really horribly strict :( It throws compile exceptions on warnings which is wholly irritating. I'll have to revisit and police every single template and make sure they are compatible.
I also noticed that the new version of xsp4 required me to be in the root folder of the website even though I was setting the root on the command line.
Anyway, glad to see it working again, even if it will be a chore to get it fully compatible. I guess it is balanced out by now being on .Net 4.5 compatible mono.
Update: I've made an adjustment to the RazorEngine code which stops it treating warnings as errors during template compilation.
Modify RazorEngine.Core/Compilation/DirectCompilerServiceBase.cs, Compile method thusly:
var @params = new CompilerParameters
{
GenerateInMemory = true,
GenerateExecutable = false,
IncludeDebugInformation = false,
CompilerOptions = "/target:library /optimize",
TreatWarningsAsErrors = false,
WarningLevel = 0
};
After making and installing mono from a tarball (http://download.mono-project.com/sources/mono/), I took the latest version of RazorEngine down from github (https://github.com/Antaris/RazorEngine), compiled using mono's xbuild tool, and then took the version of RazorEngine.dll and System.Web.Razor.dll from the RazorEngine.Core folder and used that within my applications. I removed all instances of System.Web.Helpers, System.Web.Mvc, System.Web.WebPages, WebMatrix, etc as those would have conflicted references.
And RazorEngine is now really horribly strict :( It throws compile exceptions on warnings which is wholly irritating. I'll have to revisit and police every single template and make sure they are compatible.
I also noticed that the new version of xsp4 required me to be in the root folder of the website even though I was setting the root on the command line.
Anyway, glad to see it working again, even if it will be a chore to get it fully compatible. I guess it is balanced out by now being on .Net 4.5 compatible mono.
Update: I've made an adjustment to the RazorEngine code which stops it treating warnings as errors during template compilation.
Modify RazorEngine.Core/Compilation/DirectCompilerServiceBase.cs, Compile method thusly:
var @params = new CompilerParameters
{
GenerateInMemory = true,
GenerateExecutable = false,
IncludeDebugInformation = false,
CompilerOptions = "/target:library /optimize",
TreatWarningsAsErrors = false,
WarningLevel = 0
};
Although the default for TreatWarningsAsErrors is false in Mono, I think the default for WarningLevel is -1, which doesn't really mean anything. So this might actually be a Mono porting issue.
Sunday, 22 September 2013
Bookmarks for 20130922
Ello. Not done one of these in a while. Here's the shit.
Incredible illustrations, in a very old style. http://danielmartindiaz.com
The one that caught my eye was this one, "Binary Predator" -
which can be found in an animated form in Warren Ellis's introduction to his short story "Lich House" - http://www.youtube.com/watch?v=RYScwq3EOD0
You should check out TRSST - a secure micro blogging system that recently hit its funding target on Kickstarter.
http://www.trsst.com
This is both terrifying and gorgeous. Poet CJ Allen - "Explaining the Plot of Blade Runner to my Mother who has Alzheimer's".
http://www.forwardartsfoundation.org/poetry/explaining-the-plot-of-blade-runner-to-my-mother-who-has-alzheimers/
Incredible illustrations, in a very old style. http://danielmartindiaz.com
The one that caught my eye was this one, "Binary Predator" -
which can be found in an animated form in Warren Ellis's introduction to his short story "Lich House" - http://www.youtube.com/watch?v=RYScwq3EOD0
You should check out TRSST - a secure micro blogging system that recently hit its funding target on Kickstarter.
http://www.trsst.com
This is both terrifying and gorgeous. Poet CJ Allen - "Explaining the Plot of Blade Runner to my Mother who has Alzheimer's".
http://www.forwardartsfoundation.org/poetry/explaining-the-plot-of-blade-runner-to-my-mother-who-has-alzheimers/
Wednesday, 14 August 2013
Antaris RazorEngine, Site Layouts
I have been using Antaris RazorEngine (v3) both at work and in the Asura framework used by Xizi. It is a light implementation of Razor that isn't strongly tied to MVC.
That said, documentation has been pretty thin on the ground. Especially around what I've been trying to do today which is to use the Layout functionality from within a file that is effectively in a .cshtml format.
So, the problem I am trying to address is doing ASP.Net MasterPage-like things but with isolated Razor templates using RazorEngine.
Certainly there are bits of documentation about how to use Layouts when creating and treating templates from code, but I couldn't find any complete examples on how to do it with template files.
The Layout file - mylayout.cshtml
This is a very basic layout comprised of the beginning and end of the markup and two section placeholders for "Head" and "Body".
<!DOCTYPE html><html>@RenderSection("Head")@RenderSection("Body")</html>
That's all quite simple, but the problem is that if you are using RazorEngine in the raw way that I am, then when a template tries to resolve that layout it will fail as it is not in the template cache and I do not specify a resolver delegate to be able to do it.
Instead, the layout file must be compiled ahead of time. This can be performed by the following which, given an existing pathname for a .cshtml, will compile it into the template cache:
string viewPath = @"C:\code\razor\mylayout.cshtml";Assuming viewPath is the physical path of the mylayout.cshtml file and layoutName is the simple name that this layout will be known as in the template cache. Also, there should be a critical section between the Razor.Resolve and the Razor.Compile operations.
string layoutName = @"mylayout";
if (File.Exists(viewPath))
{
ITemplate template = Razor.Resolve(viewPath);
if (template == null)
{
string templateContents = File.ReadAllText(viewPath);
Razor.Compile(
templateContents,
typeof(IDictionary<string, object>),
layoutName);
}
else
{
// already in cache
}
}
The Razor.Compile operation takes the contents of the mylayout.cshtml file and considers it with having a Model object of type IDictionary
Once the layout has been cached, any template file can use the layout.
The Template file - layout_test.cshtml
Here we go, then. This is the contents of my template, which is the one I want to use to fill the layout's section placeholders:@inherits RazorEngine.Templating.TemplateBase<IDictionary<string, object>>Firstly, the @inherits statement uses the generic version of RazorEngine's TemplateBase class to define the type that the @Model object will be interpreted as. This type should match whatever you are passing into the RazorEngine.Razor.Compile method when you compile the template. This should also match the type passed into the layout's compile operation.
@{
this.Layout = @"mylayout";
}
@section Head
{
<head>
<title>@Model["facebookAppID"].ToString()</title>
</head>
}
@section Body
{
<body>
my body
</body>
}
Next, the setting of this.Layout. This is the name by which the layout's template is known within the RazorEngine cache, so it must match what was used to compile that template. Setting this string activates RazorEngine's ability to process this template while considering the contents of the layout.
After that are two @section definitions. One of which uses the @Model object which is treated as an IDictionary
The template is compiled in much the same way, although in the Asura framework, templates are compiled on application startup and also when the last file write time is detected to be greater than that which we have recorded most recently.
Conclusion
So, long story, short, in order to get the Layout functionality working from within a .cshtml style use of RazorEngine, you have to pre-compile the templates that you will be using as a Layout before they are accessed, because RazorEngine will not do that work for you.Hope that helps some people.
Monday, 29 July 2013
Bookmarks for 20130729
Well this just pulled me out of a terrible hole ... the dreaded "case folding error" in Mercurial. The following advice worked:
http://mercurial.selenic.com/wiki/FixingCaseCollisions
And this seemed useful...
Failing over from CDN to local storage:
http://www.hanselman.com/blog/CDNsFailButYourScriptsDontHaveToFallbackFromCDNToLocalJQuery.aspx
Twitter Bootstrap has a release candidate for version 3. Not sure how I feel about this yet. On the one hand the new stuff looks amazing, on the other, I'm not sure I like the new grid classes. But, worth a look and it is admirable that they are going for "mobile-first", so rolling the responsive stuff into the main build as default:
http://twitter.github.io/bootstrap
http://mercurial.selenic.com/wiki/FixingCaseCollisions
And this seemed useful...
Failing over from CDN to local storage:
http://www.hanselman.com/blog/CDNsFailButYourScriptsDontHaveToFallbackFromCDNToLocalJQuery.aspx
Twitter Bootstrap has a release candidate for version 3. Not sure how I feel about this yet. On the one hand the new stuff looks amazing, on the other, I'm not sure I like the new grid classes. But, worth a look and it is admirable that they are going for "mobile-first", so rolling the responsive stuff into the main build as default:
http://twitter.github.io/bootstrap
Friday, 14 June 2013
Bookmarks for 20130614
"No more miracles, loaves and fishes.
Been so busy with the washing of the dishes."
I'm back. Here's some stuff.
Some useful stuff on the blueimp jQuery.UI FileUpload control:
https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data
Twitter Bootstrap is just the best bloody thing ever. It feels like cheating when using it to produce what turn out to be really gorgeous, minimalistic, clean web designs.
https://github.com/twitter/bootstrap
Whole bunch of stuff I should have read BEFORE I started writing Xizi:
http://docs.mongodb.org/manual/core/data-modeling/
IPython Notebook looks like a lot of fun, bit like a live, interactive version of One Note maybe?
http://ipython.org/notebook.html
Been so busy with the washing of the dishes."
I'm back. Here's some stuff.
Some useful stuff on the blueimp jQuery.UI FileUpload control:
https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data
Twitter Bootstrap is just the best bloody thing ever. It feels like cheating when using it to produce what turn out to be really gorgeous, minimalistic, clean web designs.
https://github.com/twitter/bootstrap
Whole bunch of stuff I should have read BEFORE I started writing Xizi:
http://docs.mongodb.org/manual/core/data-modeling/
IPython Notebook looks like a lot of fun, bit like a live, interactive version of One Note maybe?
http://ipython.org/notebook.html
Subscribe to:
Posts (Atom)
