JJHII http://www.jjhii.com Post from John's little part of the web en-us john Copyright 2024 Sun, 22 Dec 2024 11:28:18 -0600 hourly 1 Sun, 22 Dec 2024 11:28:18 -0600 Rackspace and SignalR https://www.jjhii.com/posts/id/58 Reborn.  

Recently the company I work for decided to update one of our websites from Flash to HTML5 with MVC backend.  Since there was going to be a lot of AJAX request with the server do some heavy processing we needed a good implantation of a AJAX handler for passing data from the server to the browser.  We could also see a use for having constant connections to the server in the future to add technical support and communication between users, basically a hodgepodge of features that may or may not be added someday.

 

Obviously the easiest thing to do was add something like JQuery and use their AJAX calls, there were other choices too including to build our own.  After some research I decided on SignalR for a variety of reasons but partly for it robustness, large community, and its ability to handle different browsers.

 

So after building the site we published a test version using our Rackspace account.  So far so good, there was a slight uptick in CC but nothing unexpected.  The only slight problem was the system kept losing connections which was easily solved by adding a reconnection function to the original connect.  Obviously poor internet connections and intermitting connection would cause this, mostly expected.  Things were going well so we launched the full site.

 

After a couple weeks we received the first bill which was about double our normal, ok time to start investigating.  Looking at the CC it was obvious that the CC started to ramp up from the day we first launched the site.  Now we was expecting a jump but not like this, we were looking at sub one thousand CC a day to better than five thousand per day and it was still climbing, it seems to have peaked at eighteen thousand a day.  Note this was aggregated by the fact that we could not see the CC usage until about three days after it occurred.

 

After spending some time with the helpful people at Rackspace it was determined the problem was the re-connection time in SignalR.  The connection time was sometime slow but the reconnection time was running for up to seven minutes.  This was just from a sampling of log records, it is possible that in some cases it could be longer. We were unable to reproduce this on test systems where connection and re-connection times were normally less than a second but something had to be done.

 

So we yanked SignalR and replaced all the calls with standard JQuery AJAX calls and uploaded the new site.  Mind you it would still be days before we could see a difference and the log files where still showing SignalR request but at least they were 404 now, we assume as the browsers refreshed their caches that would end.

 

So after a week our CC rate is down to the six hundred range and the site is still working well.  We will obviously have to either remove some of our future dream feature or find another way of implementing them.

 

In conclusion I don’t know if the problem was SignalR, Rackspace hosting, or something we did.  I don’t think it was something per say done on our part because of the few changes made to fix it, basically the removal of SignalR.  But it our humble opinion SignalR and Rackspace hosing are not compatible but I do think there is a deeper problem with SignalR connection/re-connection function.  I would love to dig into this deeper but we can’t simulate a large load and the Rackspace environment here so it would just have to stand as it is.

 

]]>
2015-02-26 09:16:00
The Case Against Pay for Performance https://www.jjhii.com/posts/id/57 Reborn. Interesting article: link

]]>
2014-08-15 05:09:27
WPF commands https://www.jjhii.com/posts/id/56 Reborn. I am always trying find, remember, or use these commands so here is a list for refrence.

source

ApplicationCommands
ApplicationCommands.CancelPrint
ApplicationCommands.Close
ApplicationCommands.ContextMenu
ApplicationCommands.Copy
ApplicationCommands.CorrectionList
ApplicationCommands.Cut
ApplicationCommands.Delete
ApplicationCommands.Find
ApplicationCommands.Help
ApplicationCommands.New
ApplicationCommands.NotACommand
ApplicationCommands.Open
ApplicationCommands.Paste
ApplicationCommands.Print
ApplicationCommands.PrintPreview
ApplicationCommands.Properties
ApplicationCommands.Redo
ApplicationCommands.Replace
ApplicationCommands.Save
ApplicationCommands.SaveAs
ApplicationCommands.SelectAll
ApplicationCommands.Stop
ApplicationCommands.Undo

NavigationCommands
NavigationCommands.BrowseBack
NavigationCommands.BrowseForward
NavigationCommands.BrowseHome
NavigationCommands.BrowseStop
NavigationCommands.DecreaseZoom
NavigationCommands.Favorites
NavigationCommands.FirstPage
NavigationCommands.GoToPage
NavigationCommands.IncreaseZoom
NavigationCommands.LastPage
NavigationCommands.NavigateJournal
NavigationCommands.NextPage
NavigationCommands.PreviousPage
NavigationCommands.Refresh
NavigationCommands.Search
NavigationCommands.Zoom

ComponentCommands
ComponentCommands.ExtendSelectionDown
ComponentCommands.ExtendSelectionLeft
ComponentCommands.ExtendSelectionRight
ComponentCommands.ExtendSelectionUp
ComponentCommands.MoveDown
ComponentCommands.MoveFocusBack
ComponentCommands.MoveFocusDown
ComponentCommands.MoveFocusForward
ComponentCommands.MoveFocusPageDown
ComponentCommands.MoveFocusPageUp
ComponentCommands.MoveFocusUp
ComponentCommands.MoveLeft
ComponentCommands.MoveRight
ComponentCommands.MoveToEnd
ComponentCommands.MoveToHome
ComponentCommands.MoveToPageDown
ComponentCommands.MoveToPageUp
ComponentCommands.MoveUp
ComponentCommands.ScrollByLine
ComponentCommands.ScrollPageDown
ComponentCommands.ScrollPageLeft
ComponentCommands.ScrollPageRight
ComponentCommands.ScrollPageUp
ComponentCommands.SelectToEnd
ComponentCommands.SelectToHome
ComponentCommands.SelectToPageDown
ComponentCommands.SelectToPageUp

MediaCommands
MediaCommands.BoostBass
MediaCommands.ChannelDown
MediaCommands.ChannelUp
MediaCommands.DecreaseBass
MediaCommands.DecreaseMicrophoneVolume
MediaCommands.DecreaseTreble
MediaCommands.DecreaseVolume
MediaCommands.FastForward
MediaCommands.IncreaseBass
MediaCommands.IncreaseMicrophoneVolume
MediaCommands.IncreaseTreble
MediaCommands.IncreaseVolume
MediaCommands.MuteMicrophoneVolume
MediaCommands.MuteVolume
MediaCommands.NextTrack
MediaCommands.Pause
MediaCommands.Play
MediaCommands.PreviousTrack
MediaCommands.Record
MediaCommands.Rewind
MediaCommands.Select
MediaCommands.Stop
MediaCommands.ToggleMicrophoneOnOff
MediaCommands.TogglePlayPause

]]>
2014-04-11 08:26:27
Link for using await https://www.jjhii.com/posts/id/55 Reborn. http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2013/07/03/await-task-task-wait-and-friends.aspx

]]>
2013-07-04 05:56:48
The Science of Aging https://www.jjhii.com/posts/id/54 Reborn. Interesting video on aging.  Since I take Isagenix and it is suppose to slow the aging process I always look for things that might educate me on it.

http://www.youtube.com/watch?v=BkcXbx5rSzw&feature=em-subs_digest

]]>
2013-03-10 06:42:33
PHP --- bad? https://www.jjhii.com/posts/id/53 Reborn. I guess if you have to use a langage it helps if you know the problems you may run up against.  Since I have had nothing but problems I am using this list as a way of at least giving me some warning of why.  http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

]]>
2013-02-04 06:57:41
Installing unsigned drivers in Win8 https://www.jjhii.com/posts/id/52 Reborn. Since I have been in the position where installing unsigned drivers was needed and now I find that Windows 8 makes this even harder :( the below link is to remember me how.

http://10rem.net/blog/2013/01/07/installing-unsigned-drivers-on-windows-8-64-bit-or-how-to-get-stm-st-link-working

]]>
2013-01-11 01:53:28
Windows 8 https://www.jjhii.com/posts/id/51 Reborn. Ok I upgraded my wife's laptop with Windows 8, mostly the upgrade was uneventful.

I personally found the lack of a start menu on the desktop to be annoying, my wife hated it with a passion and made several comment about how bad it was (won’t go into details).

Ignoring the start menu item things were ok, took a bit to find some of the items I needed.  I tried it on a table before the laptop and swiping in from the side was ok but on the laptop moving mouse from edge to edge was very slow.  Example was the PC setting, you have to go to the top right corner and then to the bottom right corning.  On a touchpad this is a major pain.

So we moved past those issues and started doing the zillion updates.  Does not matter how old Windows is there is always a zillion updates.  The first few batches went ok but that last too got stuck.  So first choice after the normal repair was to try MS Fix It, which failed.  Then I move to the install as stand alone, again it failed.  The problem is now when it rebooted the system when into “Automatically repairing” which failed.  Then it when to “Diagnosing PC” which went on for 2 hours so I killed it and started it again.  I tried shift-F8 but no luck.  The second time it rebooted the system managed to get though repairing and diagnosing but then went back to repairing so after 40 minutes I gave up.

So then the 4 hour MS chat which basically boiled down to making a CD (made a flash drive first but laptop would not boot).  The system is now refreshing...

Please oh please MS tell me why you hate feedback so much.  The biggest annoyance so far about this is there is NO feedback at all. I mean come on I don’t know if the computer is dead, stuck, or just really slow.  I for one do not consider a spiny thing to be feedback.  The “Refresh your PC <spiny thing> please wait” for hours is beyond annoying, really who in their right mind would thing this was useful.

Oh well at this point I won’t be upgrading any more computer so Windows 8, I may purchase one someday but it will be a while until they have worked out all the bugs and I will buy a start menu.

So far very unhappy camper...

]]>
2012-12-20 03:49:42
RAID / SQL link https://www.jjhii.com/posts/id/50 Reborn. This is a well written link on RAID types for SQL.

http://www.sqlservercentral.com/articles/RAID/88945/

]]>
2012-11-26 05:04:45
Keyboard Shortcuts https://www.jjhii.com/posts/id/49 Reborn. Things I can never remember that come in handy ;)

http://windows.microsoft.com/is-IS/windows7/Keyboard-shortcuts

]]>
2012-10-30 06:35:47
If you delelopers suck, your company sucks https://www.jjhii.com/posts/id/48 Reborn. I read the following from this link.  I agree that the employer should take some responsiblity for their employees education.

"The most important aspect of being a professional employer of software developers is that you should treat them with respect. If you’re a software company, these people are pretty much the alpha and the omega. At the end of the day, if they suck, you suck. Yes, you need sales and marketing and accounts and everything else, but all that exists around the development of the software; that’s the product, the thing that gives your company its value.

If you’re an enterprise with internal development resource, then you’re entrusting the smooth running of your organisation to your developers. If they suck, your organisation won’t function properly and it will lose money.

So respect them; nurture them; give them the time and support they need to stay, if not at the top of their game, at least no further from the top on a year-by-year reckoning. Here are some things you can do to keep your half of a learning bargain with your developers:"

]]>
2012-10-19 06:38:51
Interesting video about dealing with haters https://www.jjhii.com/posts/id/47 Reborn. http://www.fourhourworkweek.com/blog/2010/05/18/tim-ferriss-scam-practical-tactics-for-dealing-with-haters/

]]>
2012-10-11 06:23:54
Facebook Website App https://www.jjhii.com/posts/id/46 Reborn. Recently I added the option to signon to one of my wife's website with Facebook.  I used the PHP SDK from Facebook, basically I took the two PHP files merged them in one, place them in to the helper section of code ignitor project, and added it to the auto load section.  This was going fine until I moved to my wife's compute and tried it under FireFox and failed.  Hum, now I know this should not be a FireFox problem and since it worked in the other three major browser was having trouble coming up with a reason why it was not a FireFox problem.

Oh well after a hour of fighting with this I noticed that whenever I enter the website URL FireFox would remove the WWW.  A light turned on at that point, I then switch to the other browser and removed the WWW and yes they all failed.  I moved to the FaceBook app section for the app and added a second URL, one WWW and one with the WWW, another failure.

So not wanting to fight with it any longer and having been told for SEO it was better to only have one version of your website either with or without the WWW and since the WWW version worked I added a section to the .htaccess file which forced all request to the WWW version.  Guess what the site now has FaceBook login working correctly in all the browser.

You have got too love technolgy, grr!

]]>
2012-08-17 06:43:05
Visual Studio 2012 -- deployment https://www.jjhii.com/posts/id/45 Reborn. I installed the Visual Stdio 2012 RC version the other day and was not very happy with it but there was nothing major, well at least nothing I could not overcome, mostly just a matter of getting use to it I guess.

Well then I attempted to import one of my older and bigger projects and received the list of errors.  Ok this is sort of normal but I was suprised to find that the error all revolved around the project's deployment projects.  Hum, so I did a wee bit if check and it seems VS 2012 no longer has a basic deployment option, yes Click Once is still that but not really acceptable for my application.  Yes we use it in house so I am aware of its use and have used it, don't like it but it has it place.

So I installed the InstallShield LE version, what a mess that was but ok they do have an import feature so I figured I could deal with it.  Most of my installations are simple copy files to computer, setup a couple links, and be done with it.  I do have more than a few customer that have switch to 0x64 so I normally create two version, one x86 and one x64.  This is more important for projects that I can't compile under any CPU.

Well that was a failure, it seems that InstallShield LE does not support x64 installs, I will have to upgrade to either the pro version or the premier version which are $2,400 & $4,500 respectively.

I my opinion this is a mistake on Microsoft's part.  I see no reason why I should have to invest that kind of money to do a simple install.  I will be looking into other deployment option since obviouly InstallShield is not acceptable.

I did find a link on the Visual Studio user voice website, if you care to vote on returning the basic setup and depoyment project, please do it here.

]]>
2012-08-17 06:29:51
DomainDataSource with ComboBox on a form https://www.jjhii.com/posts/id/44 Reborn. I have added a form on an RIA project that I am working on with three combo boxes that are filled using the domain data source.  The problem is the form data already exists at the client when I open the child window.  This means the combo box selected value is set prior to the item source being set and as such the combo box always uses the first item in the selection and also shows the record as being changed.  Both are a problem... I ran across this post which suggested moving the domain data source into the resource section of the XAML but that did not seem to solve the problem.  What I ended up doing is waiting for the domain data source to load and then setting the form data context as below.

XAML Code:

<controls:ChildWindow.Resources>
    <riaControls:DomainDataSource x:Key="dds_countries"
                                  QueryName="GetCountries"
                                  AutoLoad="True">
        <riaControls:DomainDataSource.DomainContext>
            <l:rtDomainContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>
    <riaControls:DomainDataSource x:Key="dds_states"
                                  QueryName="GetStates"
                                  AutoLoad="True">
        <riaControls:DomainDataSource.DomainContext>
            <l:rtDomainContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>
    <riaControls:DomainDataSource x:Key="dds_residencetypes"
                                  QueryName="GetResidenceType"
                                  AutoLoad="True">
        <riaControls:DomainDataSource.DomainContext>
            <l:rtDomainContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>
</controls:ChildWindow.Resources>

<ComboBox Grid.Row="3"
          Margin="3"
          Grid.Column="1"
          DisplayMemberPath="Name"
          SelectedValuePath="Type"
          ItemsSource="{Binding Path=Data, Source={StaticResource dds_residencetypes}}"
          SelectedValue="{Binding Path=ResidenceType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Grid.Row="7"
          Margin="3"
          Grid.Column="3"
          DisplayMemberPath="Name"
          SelectedValuePath="Abbreviation"
          ItemsSource="{Binding Path=Data, Source={StaticResource dds_states}}"
          SelectedValue="{Binding Path=State, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Grid.Row="8"
          Margin="3"
          Grid.Column="3"
          DisplayMemberPath="Name"
          SelectedValuePath="Name"
          ItemsSource="{Binding Path=Data, Source={StaticResource dds_countries}}"
          SelectedValue="{Binding Path=Country, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />


Code Behind:

private int LoadCount = 3;

private void ChildWindow_Loaded(object sender, RoutedEventArgs e)
{
 ((DomainDataSource)this.Resources["dds_countries"]).LoadedData += (s, a) => { this.LoadAddress(); };    
 ((DomainDataSource)this.Resources["dds_states"]).LoadedData += (s, a) => { this.LoadAddress(); };     
((DomainDataSource)this.Resources["dds_residencetypes"]).LoadedData += (s, a) => { this.LoadAddress(); }; }

private void LoadAddress()
{
   if (--this.LoadCount == 0)     
   {
        this.LayoutRoot.DataContext = this.Address;
        ((System.ComponentModel.INotifyPropertyChanged)this.Address).PropertyChanged += (s, a) =>
        {                
            this.OKButton.Visibility = System.Windows.Visibility.Visible;          
        };
    }
}

 

]]>
2012-06-13 10:40:59
RIA remember me https://www.jjhii.com/posts/id/43 Reborn. I am working on a silverlight RIA application and don't want the option to register or remember the user.  Removing the register was stright forward, just collapse the links in the LoginForm.xaml form.  The remember me option was not as stright forward, after some searching I found this, not sure it is the best way but it works.

In the LoginInfor.cs file remove the remember me property which generates an error in the ToLoginParameters function.  In that function just change the function call so it is always true or false depending on need.  Since I don't want it to remember I set it to false.

]]>
2012-06-12 06:47:50
Added MX Toolbox link https://www.jjhii.com/posts/id/42 Reborn. Added the MX Toolbox link to the links page, very useful tool set, use it all the time...

http://www.mxtoolbox.com/

]]>
2012-06-08 09:04:21
SMTP with gmail https://www.jjhii.com/posts/id/41 Reborn. I updated an application recently that use the .NET 3.5 version of the send mail.  This has been working find with gmail for sending mail.

The problem is when I upgraded to .NET 4.0 it gave an obsolete message on the old send mail so I upgrade to the new SmtpClient.

Note the new SmtpClient is in many ways easier to use and gives better error message but needless to say it did not work with gmail, hum!

So after some fighting with the most obvious problem and seaching the net and gmail help I finally changed the port from 465 to 587 and majically it all started to work.  I am not sure why the old send mail worked fine with 465 and the new one only works with 587 but that seems to be the case.

Below is the test code I was using.

class Program
{
    static string UserId = "gmail user id";
    static string UserPw = "gmail password";
    static void Main(string[] args)
    {
        SendMail("<to email>""<from email""Test message""testing testing testing");
    }

    static bool SendMail(string to, string from, string subject, string body)
    {
        var msg = new System.Net.Mail.MailMessage();
        msg.To.Add(new System.Net.Mail.MailAddress(to));
        msg.Subject = to;
        msg.Body = from;
        msg.From = new System.Net.Mail.MailAddress(from);

        try
        {
            // 465 does not work
            var client = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
            client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
            client.EnableSsl = true;
            client.UseDefaultCredentials = false;
            client.Credentials = new System.Net.NetworkCredential(UserId, UserPw);
            client.Send(msg);
            return true;
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }

        return false;
    }
}

 

]]>
2012-05-26 04:34:47
IPv6 Survival Guide https://www.jjhii.com/posts/id/40 Reborn. http://social.technet.microsoft.com/wiki/contents/articles/ipv6-survival-guide.aspx

]]>
2012-04-24 04:48:32
Special folders https://www.jjhii.com/posts/id/39 Reborn. The below allows you to get a list of the special folders using powerscript...

Found: here

### Start of Script
### Get the list of special folders
$folders = [system.Enum]::GetValues([System.Environment+SpecialFolder])
# Display these folders
"Folder Name            Path"
"-----------            -----------------------------------------------"
foreach ($folder in $folders)
{ "{0,-22} {1,-15}"  -f $folder,[System.Environment]::GetFolderPath($folder)
}
#End of Script

Desktop                C:\Users\user_name\Desktop
Programs               C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Personal               C:\Users\user_name\Documents
Personal               C:\Users\user_name\Documents
Favorites              C:\Users\user_name\Favorites
Startup                C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Recent                 C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Recent
SendTo                 C:\Users\user_name\AppData\Roaming\Microsoft\Windows\SendTo
StartMenu              C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Start Menu
MyMusic                C:\Users\user_name\Music
DesktopDirectory       C:\Users\user_name\Desktop
MyComputer
Templates              C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Templates
ApplicationData        C:\Users\user_name\AppData\Roaming
LocalApplicationData   C:\Users\user_name\AppData\Local
InternetCache          C:\Users\user_name\AppData\Local\Microsoft\Windows\Temporary Internet Files
Cookies                C:\Users\user_name\AppData\Roaming\Microsoft\Windows\Cookies
History                C:\Users\user_name\AppData\Local\Microsoft\Windows\History
CommonApplicationData  C:\ProgramData
System                 C:\Windows\system32
ProgramFiles           C:\Program Files
MyPictures             C:\Users\user_name\Pictures
CommonProgramFiles     C:\Program Files\Common Files

 

]]>
2012-04-13 09:32:22