I recently needed to add a custom profile property to users in a DotNetNuke installation. When I went to the usual place (Admin -> User Accounts) and looked for the link, it wasn’t there!
Last night I installed Visual Studio 2012. This morning I opened up a solution and edited the web.config file – to my dismay all the color coding was gone. I think this happens more times than not for *just* XML files. Code files seemed to be ok. Not sure what exactly happened, but to fix it I had to do the following:
I recently booted up a HTML5 application that was built from the start to be iPad friendly. One of the more intricate pieces of the app draws shapes with SVG and allows the user to move, resize and rotate them via the native iOS gestures. When I left it, everything was working fine, but today when I tried it only moving worked – two finger/pinch gestures weren’t doing anything.
Yesterday I was tasked with comparing two XML documents for equality (in .NET). The catch is that they didn’t have to be *exactly* equal. There were a few fields that were allowed to be different for the documents to still be considered a match (timestamps, GUIDs, etc). My first thought was to parse and recursively walk the first document, grab the XPath for each thing I ran into and then look for the corresponding thing in the second document. Then I’d walk the second document and search the first to make sure there wasn’t too much in the second document.
When building HTML with PHP, it’s pretty common to need to emit the value of a PHP variable as an attribute value of an HTML tag. Just spitting out the variable directly will break the HTML if the value has a quote in it. There’s two functions in PHP that can take care of this: htmlspecialchars and htmlentities. Here’s a reasonable rule of thumb for which to use (stolen shamelessly from the comments on the PHP site for htmlspecialchars – I’m writing it up here because I’m too lazy to keep looking it up on the PHP site).
Today I had the “joy” of trying to integrate with PayPal Express Checkouts. The work is actually pretty straightforward and easy – it’s the documentation that’s a problem. PayPal has what must be 1000s of different places for documentation and tons of different API’s (SOAP, REST, NVP, smoke signals, morse code, etc). All the documentation is terrible, and their sandbox site is terrible as well. Overall, it’s been an incredibly unpleasant experience.
Express Checkouts is the style of paying with PayPal (and there are tons of different types) where there’s a “Checkout with PayPal” button on your cart. Users click that, end up on PayPal, pick their payment method and shipping address and are then redirected back to your site to finish up the order. PayPal actually has a pretty decent image showing how this works on their site:
This following tip is for working with data in Sql Server via either Query Analyzer or Sql Management Studio. It might work for other database platforms, depending on the tool that you use to run ad hoc queries. For those that are still interested, read on!
Developers – how many times have you selected some number of rows from a database to get a list of row IDs that you need to act on, only to have them presented in a column, rather than a nice comma separated list that would plug easily into a sql statement? You know the drill – select the column in the results, copy the IDs up to the query panel, and then do the comma-delete-end dance, building a comma delimited list yourself. This is fine when there’s 10 or 20 rows, but what about 100s? Sure, you can write a select statement that builds individual sql statements for each row that you need to act on, but there’s a better way…
Today I spent a stupid amount of time working on something that should have been incredibly simple. I’m working on a project that’s using Entity Framework 4 for its data access, and everything seems to be an uphill battle. I’m getting better with it, but today’s fun led me to post this Facebook status update:
Last night I had some “fun” with a little iPhone application that I’m writing. It has a UITableView that I fill with custom UITableViewCells. My custom cells are just a sub-class of UITableViewCell, and are built in code rather than Interface Builder. In this case, I was making an asynchronous call to a server and then updating the display of a cell once the server returned. Unfortunately, my cell wasn’t updating on the screen.
Here’s a quick note about an annoyance I have with Windows 7. When you are working in Visual Studio (2008 at least) and you have the magical little ASP.NET Development Server running, it now shows in your alt-tab list. It’s an app that you almost never need to switch to, yet it’s there. In the way. Taunting you. For one of my biggest projects, I often get three of them (an administration site, a web service and a small utility site). I’m also not crazy about how Windows 7 will sort of “blank out” all the windows of the apps that aren’t the highlighted one in the alt-tab list. When you cycle through the list quickly, they pop in and out rapidly and I find it very distracting.