Next generation's garbage RSS 2.0
# Monday, January 18, 2010
We have a client that has a WSS3 install with a single site, but wants to start creating sites for each functional group inside their organization. The bummer was WSS3's search was limited to a single site. Well, we could just replace it with Search Server 2008 Express, but that runs over SQL Server 2005 Express and is limited to 4GB on the databases so it would be a hassle to manage when it gets big.

The answer is to use both.

Here's the steps to make a test environment for this from scratch:
  1. Make a virt using Windows 2003 R2 w/ SP2
  2. Add web server role
  3. Windows Update
  4. Install WSS3 w/ SP2 which gets me the Window Internal Database (not limited to 4GB) for SharePoint content.
  5. Let the Configuration Wizard do its magic.
  6. Install Search Server 2008 Express
  7. Let the Configuration Wizard do its magic again but don't let it replace your WSS3 site - tell it to make a new search site on a random port.
  8. Turn on the "Office SharePoint Server Search Web Parts" site collection feature on the WSS3 site
  9. Install SharePoint Designer 2007
  10. Open the Search Server site's /results.aspx page
  11. Save as to WSS3 site as /results.aspx (with Don't save for the images/css junk)
  12. Add a Search Box webpart to the /default.aspx page of your wss3 site setting the "Target search results page URL" to /result.aspx
To test, I created a subsite and uploaded a sample document to a doc lib there (/inetpub/wwwroot/iisstart.htm) - let a crawl happen then searched from the root site for the word "Construction".

Now to tune this a little better, you might want to set the memory limits on the two instances of SQL running on this box now (MICROSOFT##SSEE and OFFICESERVERS). My understanding is that SQL server is super memory greedy, but the express and WID versions are less so but they still will probably push at each others memory causing them to drop cache buffers and page out IIS, ASP.NET and SP core stuff, so better to limit them.

I did this by creating the following text file (sqlconfig.txt):
EXEC sys.sp_configure N'show advanced options', N'1'  RECONFIGURE WITH OVERRIDE
GO
EXEC sys.sp_configure N'max server memory (MB)', N'256' -- <== mod this value to around 1/4 of installed memory - 1024 max
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sys.sp_configure N'show advanced options', N'0'  RECONFIGURE WITH OVERRIDE
GO
Then I ran this from the command line:
sqlcmd -S localhost\MICROSOFT##SSEE -E -i sqlconfig.txt
sqlcmd -S localhost\OFFICESERVERS -E -i sqlconfig.txt



Monday, January 18, 2010 11:18:53 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
SharePoint
# Friday, November 13, 2009
There appears to be a bug in how Visual Studio does "Add Service Reference" proxy generation for VB.NET projects.

I ran into this issue when trying to add a service reference to Bing Maps and I believe it is not limited to that. I think it stems from it misunderstanding that enum instance variables cannot be tested for equality using .Equals in VB... not sure why.

I think the solution is to simply replace the offending line:
If Me.enumfield.Equals(value) <> true Then
with
If Not Object.Equals(Me.enumfield ,Value) Then

BTW: DO NOT compare boolean results to True or False as they have done!

Use
If boolean_results Then
or
If Not boolean_results Then
[EDIT 2010-07-07]
Specifically, this block of code is wrong:
<System.Runtime.Serialization.DataMemberAttribute()>  _
Public Property CompareOperator() As SearchService.CompareOperator
Get
Return Me.CompareOperatorField
End Get
Set
If (Me.CompareOperatorField.Equals(value) <> true) Then
Me.CompareOperatorField = value
Me.RaisePropertyChanged("CompareOperator")
End If
End Set
End Property
and should be replaced with this:
<System.Runtime.Serialization.DataMemberAttribute()>  _
Public Property CompareOperator() As SearchService.CompareOperator
Get
Return Me.CompareOperatorField
End Get
Set
If Not Object.Equals(Me.CompareOperatorField,value) Then
Me.CompareOperatorField = value
Me.RaisePropertyChanged("CompareOperator")
End If
End Set
End Property
Made this edit so search engines would pick it up... so I can find my own fix next time I run into it. :) [/EDIT]

Friday, November 13, 2009 4:41:25 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
.NET Internals | Bing Maps | Visual Studio
# Monday, October 19, 2009
I'm actually going to encourage you to consider using GC methods. Well, now hang on cowboys... this is for pretty limited circumstances.

You see, the GC class can do more than compact memory. It can also run finalizers on unreferenced objects. If you are writing a class that included a finalizer (which you would only need if your class is the lowest-level class to deal with an unmanaged resource or are managing a pool of scarce resources) then you might consider using GC. Even though you might (read should) implement IDisposable, if a user of your library fails to Dispose your object, that unmanaged resource will leak until, at some non-deterministic (read random) point, the garbage collector runs and that object's finalizer might (read random) be queued and run. If it leaks often enough, your attempt to create additional objects with the unmanaged resource could fail because you have exhausted the available supply.

Rather than fail, you could attempt:

 GC.Collect(0);
 GC.WaitForPendingFinalizers();

and try again. If it works on the retry, you might want to log that for the developer's information. One might argue that this is just encouraging and forgiving sloppiness, but I look at it as a step towards robustness and can actually help the developer diagnose a real problem whereas not doing this would just lead to more random run-time only-on-heavy-load failures.

If you wanted to be really awesome, once you detect that you could recover, flip a bit on to start recording a stacktrace on each create, then in your finalizer, put that stacktrace in a application-wide queue that then gets logged by the next create. Now you've told the dev exactly where to go find the spot where they got your object but didn't dispose it.

Another place is when you are calling something that has an unmanaged resource behind it along with other code that isn't behaving. For example, you are writing a web part in SharePoint that is calling new SPSite and OpenWeb... perhaps you are being a good SPRequest citizen, but another web part on the site that you didn't write isn't being so nice.

You could make auto-recovery wrappers for the stuff you use. Your newSPSite method would attempt to return new SPSite but if that should fail, Collect + WFPF and try again. Ugh, what a pain. But sometimes it beats trying to explain to someone why it is another webpart's fault that your webpart explodes.

Monday, October 19, 2009 9:40:14 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
.NET Internals
# Saturday, October 17, 2009
Disclaimer: I'm a Ruby-n00b and just trying merb.

Did you get this after trying to
gem install merb
?

...
Successfully installed merb-1.0.12
44 gems installed
Installing ri documentation for diff-lcs-1.1.2...
Installing ri documentation for rspec-1.2.9...
Installing ri documentation for addressable-2.0.2...
Installing ri documentation for data_objects-0.9.12...
Installing ri documentation for dm-core-0.9.11...
Installing ri documentation for dm-migrations-0.9.11...
Installing ri documentation for json_pure-1.1.9...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for thor-0.11.7...
Installing ri documentation for merb-core-1.0.12...
Installing ri documentation for merb_datamapper-1.0.12...
Installing ri documentation for ZenTest-4.1.4...
Installing ri documentation for RubyInline-3.8.3...
Installing ri documentation for ParseTree-3.0.4...
Installing ri documentation for merb-action-args-1.0.12...
Installing ri documentation for merb-assets-1.0.12...
Installing ri documentation for merb-slices-1.0.12...
ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument - ./</cdesc-<.yaml

Not sure why that is, but it won't stop merb from working. I went ahead a made a for loop to install the other gems again so they'd get their ri documentation.

for %x in (merb-auth-more merb-auth-slice-password merb-auth merb-cache merb-exceptions highline templater merb-gen haml merb-haml merb-helpers mailfactory merb-mailer merb-param-protection merb-more do_sqlite3 dm-timestamps dm-types dm-aggregates dm-validations randexp dm-sweatshop dm-serializer) do gem install %x

Here's what comes from gem install merb-slices -V --debug

ERROR:  While executing gem ... (Errno::EINVAL)
    Invalid argument - ./</cdesc-<.yaml
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/ri/writer.rb:41:in `initialize'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/ri/writer.rb:41:in `open'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/ri/writer.rb:41:in `add_class'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:226:in `update_or_replace'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:89:in `generate_class_info'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:44:in `process_class'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:39:in `generate'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:38:in `each'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/generator/ri.rb:38:in `generate'
        C:/ruby/lib/ruby/gems/1.8/gems/rdoc-2.4.3/lib/rdoc/rdoc.rb:324:in `document'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:177:in `run_rdoc'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:149:in `install_ri'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:109:in `generate_ri'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:144:in `execute'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:143:in `each'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:143:in `execute'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:257:in `invoke'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:132:in `process_args'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in `run'
        C:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
        C:/Ruby/bin/gem:21

Saturday, October 17, 2009 11:35:46 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
merb | ruby
# Monday, October 05, 2009
Got the BlackBerry VS9 Plugin running in Visual Studio 2008 running in Windows 7 x64.
Not sure what of these steps are really necessary, but this is what I did:

Copied "Research In Motion" directory from "Program Files (x86)" to "Program Files". This gave me a different error.

Discovered using SysInternal's ProcMon that it was trying to launch RIM.Net.Tools.ScriptHost.exe from the root, so I copied that and all the other stuff in the plugin's bin folder to the root, yes, C:\.

That gave me another error, so then I set VS2008 to run in XP SP3 compatibility mode.

Tada!

Monday, October 05, 2009 3:09:27 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
Visual Studio | Windows 7
# Friday, September 04, 2009

Today I was doing some LINQ to objects. I was replacing a pair of nested foreach loops which built a string list and was looking for an elegant way to do it in LINQ. I ran into the problem that I needed to convert a list of lists to a single list. The following extension method works great for that. Works great for merging arrays of arrays without copying anything.

public static class ExtensionMethods
{
    public static IEnumerable<T> UnionAll<T>(this IEnumerable<IEnumerable<T>> eet)
    {
        foreach (var et in eet)
            foreach (var t in et)
                yield return t;
    }
}

Friday, September 04, 2009 4:16:24 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
LINQ
# Monday, August 10, 2009
I mentioned previously that I upgraded the hard drives in my and my wife's Sony VAIO VGN A-190 laptops to WD2500BEVE. Well, mine just died. FAIL! Less than 8 months. Not sure yet the failure mode, but I can read stuff without any reported error, but a lot of stuff appears to be corrupt (by archive testing). Also SpinRite reads along for a while and then stops with some sort of error screen. This is the fifth time I've tried to use this software with zero results. FAIL! I've taken the drive out (look [here] for disassembly instructions with pictures - I need to add pictures for HDD removal), hooked it up to another machine and copied off what I could. Warranties for WDC drives are usually 3yrs, so I'm sending it in to be replaced. I wish I could pay a bit extra to get the new WD3200BEVE which, to my amazement, is now the new capacity king in the PATA 9.5mm laptop drive kingdom -- I didn't expect any manufacturer would continue to develop new hardware for this interface. My really big complaint is with Windows security. When attaching a foreign drive the security prevents you from reading many directories, but, of course, this is a twist-tie security measure because you can simply take ownership and grant yourself rights to these directories, but this means writing to the drive -- FAIL -- a big no-no on a failing drive. I did it anyway, and I recovered what I needed to recover and I'm running again on my old stock 80GB drive, but I think the world needs a solution to this problem, so I intend to figure it out. I'll follow up when I find it.

Monday, August 10, 2009 10:21:09 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
Hardware | Security
# Thursday, July 23, 2009

Take your application's 512x512 icon and make a copy in your ad-hoc's build folder called iTunesArtwork (no extension).

#!/bin/bash
rm -r Payload
mkdir Payload
cp -rp myapp.app Payload
rm myapp.zip
zip -r myapp.zip Payload iTunesArtwork
rm -r Payload
rm myapp.ipa
mv myapp.zip myapp.ipa
Thursday, July 23, 2009 8:11:07 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
iphone
Archive
<January 2010>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
All Content © 2010, Hafthor Stefansson - Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way. - Sign In