Code, Code, Revolution!
I got involved in a mysterious user rights problem with a Sharepoint MOSS solution that we recently delivered to a customer. I wasn’t able to find much about this so I thought I’d share.
The problem was isolated to the main portal site collection which allowed everyone with an AD account to read pretty much all content in the site collection. All other site collections worked the way they were supposed to, which meant not allowing access unless it was given. Of course the first thing was to verify that anonymous access indeed was disabled and that the authenticated users group wasn’t given any rights. Further investigation gave the following confusing results:
Read the rest of this entry »
I encounterd a confusing error today when I was about to deploy a bunch of webparts in a Sharepoint MOSS farm. Stsadmin gave me the following error message for the command “stsadm -o AddSolution -filename ReportBroker.CAB”:
“reportbroker.cab” has an unsupported extension, and cannot be added to the solution store.
I found the answere to the problem on this blog. Apparently stsadm supports “.cab” but not “.CAB”. I have no idea why I had the extension in upper case from the start…
Facebook released a new version of their iPhone application, bringing it to version 2.0, just a few days ago and I must say I’m very impressed. It’s not that I’m a big Facebook fan, I check my profile once or twice every week. But Facebook is always ahead when it comes to new cool features both on their website and their iPhone app. I really like the new horizontal scroll menu in their 2.0 version, in fact, I was so impressed I started making my own ripp-off yesterday evening. Hopefully I’ll be able to release a complete sample horizontal scroll menu control sometime next week. The tab-menu was also new and it goes well with the way the web page works, but what I don’t like about the whole application is that the top 40% of the screen is basically menus and buttons. The nice thing about the horizontal scroll menu is how much it fits without wasting space.
Come back later for an update on my facebook-style horizontal scroll menu.
You find the code here
Just starting with a new language and new framework you always run into problems that you never thought would be a problem. I’ve encountered the problem of finding out the height/width of text when drawn on screen when I was working with a Java applet. Now that I’m working on my GPS and internet aware iPhone app, together with my good friend since preschool and now colleague Hampus at Avantime, we consume a web service which serves us information. Of course, when fetching information from others you seldom know how much information they will send you. Working with a competent device like the iPhone I was surprised how much time I spent searching for the proper way to do it. When looking at the API reference I thought that setting the number of lines to 0 would do the trick, which it doesn’t. I tried everything I could find in the API reference but nothing would produce the multiline label I wanted. In our application we present the information in a nice UITableView, just like the Facebook application does (Facebook 2.0 application is awesome btw!). Eventually I found the method sizeWithFont in NSString which does exactly what I want. Here’s my static method that I will return the appropriate height for a label with a given width, font and line break mode:
Read the rest of this entry »
NOTE! I’ve updated the InternetImage class, read about it in this post: Downloading an image asynchronously. Revisited!, you will also find the revised code there.
In a recent post I showed you how to round of edges of an image. But how can you go about downloading images from the internet in your iPhone app? There are two possible ways of doing it: synchronously and asynchronously. Which way is best depends on what you are trying to do but it’s generally better to download asynchronously as the user probably doesn’t want to wait for an image to show up before being able to interact with the application. Downloading an image synchronously is well easy:
UIImage *myImage = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:strImageUrl]]];
Downloading an image asynchronously requires a little more work. I created a class to handle the download for me. Instead of posting the entire class I’ll explain it a little bit and provide the actual code files at the end.
Downloading an image, or anything else for that matter, asynchronously from the web requires the use of a NSURLRequest and NSURLConnection. Supply the NSURLRequest to the NSURLConnection and provide a delegate for the connection. The delegate is self, because i want my class to handle the events from the connection. We also need NSMutableData to hold the downloaded bytes.
Read the rest of this entry »
UPDATE 2009-04-05
I’ve updated the code in the post and the sample project at the end of the post. Many thanks to Xavier Schott for his helpful comment!
I recently dwelled into the world of Cocoa programing for the iPhone a few weeks back. My good friend and collegue at Avantime, Hampus, and I bought iPhones 3G when we were on vaccation in Italy this summer. Italy sells unlocked iPhones so we’re not stuck with using Telia which is the only Swedish operator who carry iPhone. I actually had a quick look at iPhone development when the first iPhone came out using the toolchain but I didn’t really enjoy it at the time, perhaps it’s because I only owned an iPod touch at the time.
Anyhow. Hampus and I have been hacking away on our first iPhone app and I thought I’d share some usefull code for rounding off corners of an UIImage. This code is based on various stuff I found on google but I made a nice image manipulation class which rounds of corners:
Read the rest of this entry »
I was recently involved in a big Sharepoint MOSS project for a major Swedish technical consultant firm. They have offices spread out over Europe and participate in global projects. The new Sharepoint project involved a process management tool and project collaboration areas, both tools to make their daily work easier. But the goal of the entire project was to provide a tool that made it easy to re-use solutions and spread experience throughout the organization, ie, make it searchable. Sharepoint was the perfect platform for them! One of the major challenges with this project is the huge amount of data they produce each year. CAD-drawings and documentation push their yearly data to somewhere around 3TB each year!
What does this have to do with SQL 2008 binary data performance you may ask, or you already know because you have Sharepoint experience. Sharepoint stores all it’s information in an SQL database. Normally that’s not a problem when people share documents and presentations well under 50Mb each. The default limit in a standard Sharepoint MOSS / WSS 3.0 installation is 50Mb per file. In a servicepack however Microsoft enabled the possibility to increase this limit to 2Gb per file. 2Gb is a lot and arguable files that big shouldn’t be stored in a database, at least not a SQL 2005 database.
Read the rest of this entry »
A while ago a customer invested in a SQL-cluster and naturally wanted to move all databases there. There are a number of articles on the net on how to migrate to a new server, some more complicated than others. In my case I had a working SQL 2005 instance which was dedicated to the MOSS installation and wanted to move to a new SQL 2005 cluster. Instead of rebuilding the entire farm like some people suggest i found it easiest to use the “rename server” command in stsadm. Here’s a step by step guide:
Read the rest of this entry »
With this blog I try to provide useful tips and solutions for programming .NET, Objective-C and more. My name is Björn Sållarp, and I love writing code.