Showing posts with label Internet. Show all posts
Showing posts with label Internet. Show all posts

Thursday, April 09, 2009

Tweet Delete?

Ack! all of my twitterings since over a month ago have disappeared!

I feel lost! They were only silly irrelevant mutterings for the most part, but they were my silly irrelevant mutterings and I trusted you to store them!

I have logged a ticket with twitter, hopefully they will return from the void…

Wednesday, March 04, 2009

Virtual Root (~) gives 404 error

We had a server reboot after a power failure yesterday, and this morning an ASP.NET application that has been working for months started giving this error:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /~/direct.aspx


Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

Seems to me that it is not translating the ~ into the Application Root path, but I am at a loss as to why. I have posted a question about the ~ virtual root giving a 404 on the ASP.NET newsgroup, but as is often the case with these WTF kind of posts I am not really expecting a response…

It was easily ‘fixed’ by just making the form action use the absolute path to the aspx file, but I want to know why it is broken.

Tuesday, February 24, 2009

A little love for Windows Live Writer

Problem solved.

There was some odd “bug fixing” stuff in the blogger theme.

.post-body p {
  line-height: 1.4em;
  /* Fix bug in IE5/Win with italics in posts */
  margin: 0;
  height: 1%;
  overflow: visible;
}

This was confusing WLW a bit obviously. I just removed this (sorry no more support for IE5 *pfft*) and all is well. the problem that I thought I was going to have with the empty p tags between each paragraph that I was getting but do not get when WLW is working properly is a non problem. The actually empty tags: <p></p> are not rendered at all, only the tags that WLW was inserting: <p>&#160;</p> with that non breaking space in there were causing the blank paragraph to be given some space – and these are not generated when your CSS is okay.

So everything work as far as I can see. Looks like a real WYSIWYG editor now. I can click anywhere, I can insert lists, I can probably stop checking the mark-up like a freak…

Thanks Joe Cheng! You rock.

Sunday, February 22, 2009

Bad Xml – to accept or to reject, that is the question.

Was just reading this post which touches on accepting invalid Xml communications. And I agree.

I think it boils down to “make sure you produce good XML, but accept anything with the proviso that there may be odd behaviour if the format is not correct”. Library wise though, permissive reading is fine, but if your library produces bad XML you deserve to be stamped out. I have to say that the Microsoft Xml stuff is really pretty good. They are an option 1 library though, so don’t expect to be able to read in any old just, but they will not produce invalid Xml*.

This is the route that I have gone with all of the stuff that I have been doing lately. It is a little more complicated than that though because the data structure that I am using is created from the DTD** so I need to not only accept invalid XML but convert it into valid XML to store it.


* This is something that I have had to explain a few times… Sometimes is is difficult, sometimes people understand. Mostly I don’t bother complaining too much about receiving nasty Xml, but forcing myself to produce bad Xml because someone’s hand coded parser reacts badly to something valid in my valid Xml (namespace definition).

** Funny story. It’s their DTD, but they can’t manage to produce Xml that validates against it, and they expect values for certain elements that are not valid under it (value="" when value is an NMTOKEN). Chuckle…

WLW tag problems

After looking at this post from someone with formatting problems in WLW, I have switched WLW into editing without the template. Looks nasty, but the mark-up is nice.

Only problem is that now it does not put a blank p tag in between each paragraph. So I would go and change the template to add some margin to the end of a paragraph to get my spacing back but then that is going to stuff up all of the old posts! Ugh. I do not want to go back and edit them all again! I already did that once…

It would be nice if I could modify the tag that WLW puts in for a paragraph to include a class attribute – that way I could modify the template so it only affected these new posts… Actually, that is something that is a bit of a problem with Blogger in general – changes take effect on all old posts. E.g. if you change the time zone. Not much you can do about that though really.

Saturday, February 21, 2009

Login or Register

When you have a site that uses user accounts, say for returning customers, I really hate the common theme of having a login fields area and a register fields area.

Mainly because I can’t always remember if I am registered or not. Why not make the forms do double duty as login and registration forms? You put in your email address* and what you think is your password and hit the button. If that user exists and the password is correct, let me in. If that user exists and the password is not correct, bounce me with a message. If that user does not exist, go on to a registration page and get the rest of my details**, and keep the hash of my password so you only have to confirm it not get me to type it twice again.

Streamlined. The only thing that I can see that is wrong with this idea is that it does give away some information, namely the form tells you that a certain email address is registered on that site. However the existing registration form does that anyway so…


* I am pretty much a believer in the email address as username idea. There is never going to be a problem with your desired username being take already, and people who complain that they have too many email addresses or they change them often or whatever… pfft.

** Or better yet – don’t ask me for any more information, just to confirm the password. Oh, and make sure I can continue on with what I was doing.

Google JavaScript error AGAIN

What the hell Google? A JScript error again? Last week it was AdSense, this week it is in the Followers gadget.

I just happened to look at my blog before thinking about posting something and up pops a JScript error and then a blank blog page. Nice. Upon debugging I see the error is in this line:
google.friendconnect.container.renderUrlCanvasGadget({'id': 'gadget-canvas'})

Which look like it might be the Followers gadget. I disable it and no more error. So not too hard to get by, but what the hell is with all these scripting errors?

I think there might be some kind of problem with the QA and deployment strategy over at the big g…


[Edit] I went and put the gadget right back again, and the error does not reoccur… I can’t see that line of code anywhere at all, so I don’t know if that was not the problem or if it was fixed quickly or if adding and removing it updated the code or what… Gotta go.

Wednesday, February 18, 2009

Adding text to a WLW post without screwing up the mark-up!

Finally! I have discovered a way to add text at the end or middle of a post without causing horrible nesting problems with the <p> tags.

If you just go clicking at the end of an existing paragraph, or even on it, or even clicking in a space that looks blank, it is pretty easy to end up with this kind of mess:

<p>
  <p>para1</p>
 
  <p>para2</p></p>

But now I have managed to work out how to avoid it! As an example, to add a paragraph to the end of a post:

  • Hover over the invisible box that represents the blank <p></p> that WLW sticks after each paragraph with text in it. You are looking for the North South East West arrow cursor.

  • Click to select it. You need to end up with the eight little squares in the corners and on the edges showing that the whole element is selected, not the insertion point indicating that it is trying to add text inside the element.

  • Now press the right arrow key. You should end up with the insertion point below the element you clicked on. Now you can type and the text will go into the paragraph element and pressing enter at the end will close the current paragraph, insert a blank one and start a new one. Remember also that you do need to press enter at the end of the paragraph, even the last one, to get the tag to close properly.

To insert a paragraph between two existing ones, you want to do the same thing with the invisible blank paragraph element between two with text in. When you press the right arrow it will look like you are in the next paragraph with text, but you aren’t. Once you get to the end of your paragraph and hit enter all will be well again.

I feel like I am 90% of the way to being able to use WLW without switching to the source pane all the time – which is how you bloody well should be able to use it. It is just a bit unfortunate that I have to do it by being careful where I click and type and so on.

Gmail 2.0 and scrolling in IE7

Gmail’s new version 2 interface might be a slight improvement visually, but it sure does not like Internet Explorer 7 very much.

If you use the scrollbar at all the cpu usage for iexplore.exe gets pegged to 100% for a couple of seconds. I have not looked into what it is actually doing yet – not interested enough perhaps. If you switch back to the old interface (there is a link up on the top right of the page) the problem goes away. The only hassle is that this setting is not saved, the next time you log in you are back to the regular interface.

Curiously if you scroll with the keyboard it works fine. Scrolling with the scroll wheel or the edge of the touchpad hangs it up too. Seems to be in the handling of the onScroll (or whatever) event.


[Edit] It seems to be a problem with FlashGet. Disabling the FlashGet GetFlash Class makes the problem go away. Interestingly enough FlashGet still seems to work just fine…

Tuesday, February 17, 2009

Lotsa windows

I just had a weird occurrence… I was in gmail, clicked to archive a message, and it started to open a bunch of new windows with one certain address:
http://mail.google.com/mail/#..&remote_iframe_0@2&1&0&%7B%22s%22%3A%22resize_iframe%22%2C%22f%22%3A%22remote_iframe_0%22%2C%22c%22%3A0%2C%22a%22%3A%5B199%5D%2C%22t%22%3A%22r0rtgf-lsmnyy%22%7D

It got to about 20 or so before I managed to kill it with taskman.

Wednesday, February 11, 2009

AdSense JScript error

I don’t know wether it is just IE7 or what but I do seem to be getting a lot of JScript runtime errors on lots of different sites… I have opened a few in the debugger and found them to be, for the most part strangely, coming from within jQuery…

Now the AdSense stuff on this blog has started to have an error:

The bit where it barfs is:

<script>tick('1ad')</script>

with:

Object expected

so meh, not finding the tick function. I have not changed anything, but I am beginning to wonder if it is not something that I have done to this machine. Perhaps I am just paranoid, but I do seem pretty capable of some kind of voodoo against windows installations…


[Edit] S’not just me - there are some posts on the AdSense Help forum (which has a JScript error, haha) about this already (Recent Javascript Errors in Ads, Javascript errors, JavaScript error <script>tick('1ad')</script>) but no response from Google so far...


[Edit] Silently fixed by Google. I did not keep a copy of the offending source file from this morning, but looking at the same file generated just now, they seem to have totally removed the call to tick. That function by the way ends up injected into your main page and seems to be for storing timestamps for certain actions like the first load, the first time the page is scrolled, the load time of each ad etc.) Poor form really… perhaps an explanation will surface soon.

Sunday, February 08, 2009

WLW Plug-in

I just finished working on a Windows Live Writer plug-in to allow insertion of snippets. You can define templates for snippets that you can then insert into the current document from the Insert list. The snippets can be anything basically, but I will be using it to insert HTML snippets of the right format to make error message blocks, command line blocks, basically all of the little bits of mark-up that I want to re-use all of the time.

To create a new template you access the options dialog via Tools > Options > Plug-ins where you select the Snippet plug-in and click Options.

You can insert the currently selected text or the clipboard contents into the template by specifying #content# or #clipboard# somewhere in the template. You can also take the content or the clipboard if the content is blank with #contentorclipboard# or the reverse with #clipboardorcontent#.

There is no documentation (other than the info here), no installer (you just need to copy the dll file to C:\Program Files\Windows Live\Writer\Plugins), and not too many features. So hopefully not too many bugs. There are a few things that I would like to work on: A context menu to select the #content# things; Pretty up the interface a bit; Add a different mode that can ask for user input to fill in the template; An installer.

I created a Google Code project for this one too, it is wlwsnippetplugin. I think that I have put the source up properly in the SVN repository… Regardless, the source is zipped there too, as is the SnippetPlugin.dll file that you can just grab and copy to the right directory.

Enjoy!

Mark-up cleanup

I have just spent some hours going through all of my old posts and editing them in WLW to get all the mark-up nice and neat and how Blogger and WLW likes it.

I have put everything in p tags, removed all of the display oriented tags (fonts, inline classes), and fixed up the code and error message and command text blocks that I had. I think I fixed most of the quote marks and apostrophes too - mainly because WLW does it automatically and they do look pretty neat.

I guess that is all a bit anal, but I do feel clean now.

Friday, February 06, 2009

Windows Live Writer first paragraph problem

I was having trouble with WLW messing up the mark-up for the first paragraph when I start a new blog entry.

Once I had typed the first paragraph then pressed enter, rather than starting a new paragraph tag after the first, it inserted a new one in the first one before the text. After that the paragraphs come up in pretty much the right order, but the nesting is all wrong and not at all what you would want.

Here is an example of the mess that it manages:

<p>
  <p>Second paragraph.</p>
 
  <p></p>
Third paragraph.
 
  <p>First paragraph.</p></p>

What you want really is this:

<p>First paragraph.</p>
 
<p></p>
 
<p>Second paragraph.</p>
 
<p></p>
 
<p>Third paragraph.</p>

I have finally worked out what was causing this. It was the fact that I was clicking in the edit area before typing! So if you edit the title, you need to NOT click in the post body area, you can just hit Enter after you are done with the title and it seems to work.

Unfortunately, clicking will have bad effects on the mark-up whenever you do it in a blank area… You need to be clicking in an existing paragraph or else it seems to get a bit stuffed up. I am still trying to work out exactly which action causes which problems and hot to possibly avoid them. One is to paste in the html for a paragraph with some text in it rather than clicking at the end of a post to add a new paragraph. This is a beta product though so I guess one is meant to deal with quirkiness.

Another related note: you really have to hit Enter at the end of a paragraph, even the last one. If you don’t you can end up with:

<p>Paragraph 1.</p>
 
<p></p>
Paragraph 2.
 

I like WLW. I am sure there is not much more to go before it is kind to your mark-up. The sad thing is that this kind of stuff is probably not that important to a lot of people.

Thursday, February 05, 2009

Windows Live Writer and Blogger formatting

I think I have it worked out.

There is a Blogger setting that stuffs up edits done with Live Writer. Settings > Formatting > Convert line breaks needs to be set to No. Then you don’t seem to get the double line spacing.

The trick with WLW seems to be to let it put in paragraph tags and to never ever edit the post in blogger. Or at least to never switch between the blogger html editor and the compose editor – that really screws things up.

In the end, WLW is still in beta so there are issues. Undo does not do what I would expect. You can’t just type away and press enter to get a new paragraph… Seems like for the first paragraph you have to hit enter then the down arrow otherwise the insertion point is above the first paragraph container. Odd.

I will just resign myself to being careful with the editor, then being prepared to fix the mark-up by hand.

The CodeSnippet pug-in works best if you do not embed the styles but copy them to your template to be re-used. That is how I wanted to do it anyway. Here is a little code snippet:

// Check for required fields
foreach(var f in from f in TheForm.Fields
                 where f.RequiredForEmail
                 select f) {
    prop = requestType.GetProperty(f.Name);
    if(prop == null || prop.GetValue(data, null).IsBlank()) {
        Ok = false;
        break;
    }
}

CodeSnippet plug-in

Dammit. Those code snippets look so nice in Live Writer… grr. They get all sorts of horrible linebreaks and the formatting does not work at all. Work dammit!

Explorer:

Live Writer:

Grumble.

Saturday, August 16, 2008

Windows Live Writer

I finally got it set up. A big Fuck(*) You Very Much goes out to whomever wrote the automatic configuration part. Use the damn default web browser to go get your pages, not Internet Explorer! Why would you hard code it to use Explorer? My explorer is configured to only work when I am connected to the VPN and hen only for internal addresses! I had to go change the proxy configuration (after I worked out why it wouldn't work)... Now I just wonder if other parts of Live Writer do this and get upset every time I reboot and reset the proxy configuration? Stupid.

Anyway, looks nice enough.

Where do the drafts go? ... Only local looks like for Blogger, the publish draft is greyed out.

Apparently, by installing a little code snippet (... painless) one can post neat looking code samples:

   1: <controls:PathDuplicator>
   2:     <controls:PathDuplicator.ItemStyle>
   3:         <Style TargetType="controls:Item">
   4:             <Setter Property="Template">
   5:                 <Setter.Value>
   6:                     <ControlTemplate TargetType="controls:Item">
   7:                         <Grid x:Name="RootElement" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.8,0.8">
   8:                             <Path Margin="18,9.36900043487549,37.2080001831055,27.5090007781982" Data="M50,14 C42.942787,12.875842 37.481071,3.0378544 31,16 C29.399416,19.201166 27,22.378658 27,26 C27,31.253759 25.183334,31 34,31 C35.521332,26.436005 38.284637,24.241812 43,21 C49.555965,16.492775 47.970417,15.455626 55,26 C63.315838,38.473759 64.010223,47.474442 57,65 C55.737644,68.155891 49.410244,76.01281 43,68 C37.249264,60.811581 38.936535,57.9706 36,50 C34.534855,46.023182 28.36919,45.217796 23,51 C17.748837,56.655098 20.123365,57.791729 18,65" Fill="#00FFFFFF" Stretch="Fill" Stroke="#FF000000"  RenderTransformOrigin="0.8,0.8"/>
   9:                         </Grid>
  10:                     </ControlTemplate>
  11:                 </Setter.Value>
  12:             </Setter>
  13:         </Style>
  14:     </controls:PathDuplicator.ItemStyle>
  15: </controls:PathDuplicator>

Hrm. How does one modify the styleses? I guess if I go put them in the configuration of the blog that is easy enough. Would be nice to see the actual styles in the plugin though. Nevermind! Also, the view HTML thingy in the plugin does not show the correct html if you select not to embed the styles, it still shows only the html with the styles embedded. Also also, why not define the styles inline as actual styles rather than setting the style property of each element... just saying.

After stylish modification:

   1: public override void OnApplyTemplate() {
   2:     base.OnApplyTemplate();
   3:  
   4:     RootElement = (Panel)GetTemplateChild("RootElement");
   5:  
   6:     // Just make some transformation adjustments
   7:     for(int i = 0; i < 10; i++) {
   8:         Item item = new Item();
   9:  
  10:         #region Silly Stuff
  11:         item.Style = ItemStyle;
  12:         item.Angle = 10 * i;
  13:         #endregion
  14:  
  15:         RootElement.Children.Add(item);
  16:     }
  17: }

Well, wow. Now if only I could get Studio to do alternate line colouring... Can you do that? :) I guess I would also like to see the plugin support more of the Studio display items. But it looks pretty close to how it looks with my settings.

I guess I just need to find out when it uses each of the styles... and go create the styles for each type of code snippet...

Joy!

(*) Fuck is not in the dictionary... well now it fucking(**) is!

(**) So is that :)

[Edit] Not joy! Unjoy! What is with the 3 line spacing in the code samples?! Grumble... In fact, what is with the massive amounts of extra space all over the place. Grr.

[Edit] Fixed spacing. WLW editing still a bit dodgy, but it is easily fixable in the source edit view. Can't way that I could recommend it to anyone that does not know html – i.e. 90% of people who want to blog and would love a real WYSIMYG editor... Mind you those kind of people probably would not really care about how their markup looks - which incidentally makes it all the more vital to help them produce good markup.

Sunday, May 18, 2008

One bad apple?

It's funny, just about every website you go to sign up on that wants your email address gives you those TWO boxes to fill in. Email and Verify Email. I don't who started this, or why everyone thinks they should follow, but I wish it would stop.

I understand where this malady came from: it was some smart web monkey seeing the Password and Validate Password combo and adopting it. But I don't think they quite understood why this mechanism is needed in that case. Just to be explicit - it is only needed because you can't read what you just typed in in the Password box. For the email address, I can re-read that just fine thanks.

Besides, I figure if you can't either type in your correct email address, or read that is not correct and correct it, then you failed my minimum user requirements. There is a certain limit to how far you need to go holding people's hands.

Wednesday, November 28, 2007

The tale of Mister Splashy Pants

Online polling is broken.

With sites like digg and reddit and many others, the ease with which a group of people can sway the vote is demonstrated time and again. The problem is differentiating “real” voters from “funny” voters. It is just too easy for someone to give a voting link to a large number of people who are not really interested in the outcome of the poll, who will totally unbalance the results.

Perhaps what online polls need is to use some of the mechanics of regular political voting systems. An electoral roll with a defined closing date that is before polling commences. No need to keep voter information long term, just long enough to have the people interested in a certain poll indicate their participation, and ensure that there are no band-wagon jumpers at the last minute. An online news site post saying “Quick, register to vote on the name of the Greenpeace whale - there is sure to be a funny option: we will let you know which option we think is the funniest in a few days!” is not likely to attract the same level of attention.

Wednesday, May 23, 2007

Web 2.0 style guide

Orange! Light green! Dark blue! Light blue!

Very faint diagonal or way off-centre circular gradients.

Dark text on light same coloured background.

Dotted (light coloured) borders (and horizontal rules).

Shiny glass or gel (jelly!) looking buttons (that are not usually buttons) and text.

Text sitting on a shiny table and all manner of other (3d) surface effects.

Big bold headlines. Often multiple down or diagonally across the page.

Smaller (gray) body text with lots of white padding.

Many pointed stars.

Cute icons.

No underlined links.

Digg this, post on reddit, blog this, tag on del.icio.us, etc., etc., etc. buttons.

I'm not saying that any of this is good or bad, just what I have been noticing.