Recently, I was tasked with creating a minified version of a web applications Javascript files.
I settled on the Yahoo YUI Compressor, in particular, the .net port of it
When I tried to compress a particular file (the jquery.caret plugin), it would throw up a syntax error.
This error only occurred using the .net port of Yahoo YUI Compressor.
Using the standard java jar version of YUI Compressor did not throw such an error.
The error was a syntax error on this line:
(function($,len,createRange,duplicate){
It was saying invalid character at position 0.
After some time scratching my head, I opened the file in notepad++ and converted text to hex 16
Immediatlely, I could see there were some invalid characters around the function text:
Removing those characters and saving the file solved my problem, and allowed the file to compress.
I looked at the issues page for the jquery.caret project, and found this issue had already been reported
Update
I’ve created an issue on the codeplex page for this now:
Although it’s not ideal, we can use sequential / incremental IDs with MongoDB. Sometimes (when migrating legacy systems for example) we just can’t get away from using ints for id’s.
While working on implementing MongoDB with N2CMS recently, I came across this very problem.
All IDs are integers, and this can’t be changed (technically, it could… but I don’t think it’s appropriate… yet)
So, we needed to find a way of generating incremental IDs
It works on the principal outlined in my previous blog post: Have a collection that keeps track of collection names, and increment their sequence each time one is inserted
This works well, on single server setups.
I have not yet tested on other setups, but intend to soon.
I’m on the verge of being able to release a second, much improved version of the Joe Blogs WordPress & MetaWeblog API Wrapper.
Some very brief details below, and a cry for help (or several cries!)
New Features / Improvements
Friendlier API Instead of having to deal with the XML-RPC interfaces directly, I’ve added a “friendly” layer of classes on top. The WordPressWrapper class has helper methods, with friendly properties, for doing things like uploading files etc…
More examples The sample project (console application) included in the project demonstrates all methods and features of the library.
Better documentation XML RPC Comments on all the public properties and methods
Help required
I need help with some of the following, both for this version, and subsequent versions
PHP WordPress Re-install script Script (configured as CRON job) to “refresh” test install of WordPress (every couple of hours or something)
Unit Tests Need better code coverage., and more integration tests I’m not TDD expert, so unfortunately, a lot of this will be retro-fitting unit tests into the current code.
WordPress Plugin development I plan to release an “extended” version of XML RPC – with some enhanced methods in, for use with JoeBlogs – for example “GetRecentPosts”
ASP.Net Demo Project Eventually, and ASP.net MVC “blog” project, running from WordPress – for no other reason than “it can be done”
Moving project to GitHub See below
General code improvement Refactoring, performance enhancements, etc…
Logo Designed ‘cos every cool open source project has to have a cool logo, right?
Website I’ve dipped my hand into my pocket, and bought joeblogswrapper.org (under £7 – GoDaddy) Will have a site dedicated to it on there soon. Obvious CMS choice would be WordPress, but if anyone can think of a better option for Wiki style pages, I’m all ears (Media wiki..? What are the benefits?)
Mailing List
I’ve created a Google Group – http://groups.google.com/group/joeblogs/ Please, sign up on there for announcements (I’ll announce when the next versions of the wrapper are available)
GitHub
I really like the idea of moving this project over to GitHub.
Problem is, I have absolutely no experience using Git.
I’ve tried following the instructions, and got as far as some files imported into my repository.. but I can’t get it to work, or commit my changes.
If anyone would like to offer their hand-holding expertise on getting this moved over (and training me on committing files etc…) then I’ll gladly move it to GitHub, which long term, I believe could be beneficial to the overall development of the project.
Get in touch
If you’d like to help with ANY of the above (or anything I’ve missed for that matter) please get in touch, or use the Google Group
After attending the UK Tech Days events last week in London, I was keen to jump on the Visual Studio 2010 and .net 4.0 bandwagon.
I converted some of our projects here at Crocus to the .net 4 framework (which was incredibly easy – nothing broke!)
I even took advantage of some of the quick to implement features in .net 4, and converted some of our massively over-ridden methods to use optional parameters.
This has a Visual Studio deployment project associated with it.
After building the newly upgraded .net 4 version of the project, and deploying the .msi file to our target server, I got the following error:
Error 1001 Exception occurred while initializing the installation. System.BadImageFormatException: Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Now, I had definitely upgraded said server to .net 4 (twice, as a matter of fact – after the first time i received this error!)
After some Googling, some people were saying to change the platform target on my assemblies, which i did, to no avail.