Archive

Posts Tagged ‘Bugs’

Windows 7 Command Line Help mistake for IF command

If you type

help IF

at the Windows 7 command-line (can launch this by searching at Windows Start menu search box for “Command” or by typing cmd there and pressing ENTER), you get in one of the help pages printed out for the batch files’ IF command:

%ERRORLEVEL% will expand into a string representation of
the current value of ERRORLEVEL, provided that there is not already
an environment variable with the name ERRORLEVEL, in which case you
will get its value instead. After running a program, the following
illustrates ERRORLEVEL use:

goto answer%ERRORLEVEL%
:answer0
echo Program had return code 0
:answer1
echo Program had return code 1

If a program you launched from the batch file returns error code 0 (meaning usually no error), then you jump to label (using “goto” command) answer%ERRORLEVEL% that is answer0 (labels are prefixed with : in DOS/Windows batch files) and it prints out (using echo command) on the console “Program had return code 0”.

Fine till here, but then it will proceed to next commands (the block labeled :answer1) and also print out “Program had return code 1”. Obviously the correct example should be:

goto answer%ERRORLEVEL%
:answer0
echo Program had return code 0
goto finish
:answer1
echo Program had return code 1
:finish

Could also have a goto finish after the last echo, but its needless since we don’t have :answer2 etc. labels after that and proceeds to finish by itself anyway.

Thinking of this example again, it’s a pretty silly one since one could do instead:

echo Program had return code %ERRORLEVEL%

BTW, to output an empty line to the console you can use echo:
And speaking of batch file tips, you can use :: for comment lines instead of REM command.

Η σελίδα σφάλματος του YouTube

500 Internal Server Error

Λυπούμαστε, κάτι δεν πήγε καλά.
Η διευθέτηση του ζητήματος έχει ανατεθεί σε μια άρτια εκπαιδευμένη ομάδα μαϊμούδων.

If you see them, show them this information:

IH6pYV6uW08aEw7RTmh2nctOCLKwYBoSQTT250UKk1Aq9OGTSu0MO16kB8kH
IX8I1EZVDq2NHuva2SRpXGL6hG38xdffPCV3YBYJu8LVe1L9r7vz_fQrTavV
aEsYIAILDGIATDB2OC78kZeqDUS9jeQzQqBiA6_Q7RDGkivkzT6XcaChvBAI
TVWzwDPaNPJV8J7m2aqxgprbkCwzzcIfMD1toWoe4cbls7NqoBvCYAEsfZKD
HlQ_3ylykRbFkJfi1HapcCFYJvnFB-6wyNYtgciyVu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S2xFBBqT
VRrEAg9vpsEYx8h9H2xjOjHVdOpsoCDi4CkSKLmczZ-IMzvx6eajUWuaZMT5
01a-vSK_dis7lHtI_2UWydC_eZN2HGRP-4meXByQ8AupsSoWrz0eUhdIMFSe
uQzEPRMOrMJ7yBxobSFYnubs6CRNWwxiV7r6HT_RIjaql6j6wvCBSWtT6Ko3
Gz7hoShAjBRMwNROLUMtFt1VrDbH5VvmZ8UEPNbeY4hyNLIQOWyA3gcgHtZZ
Zl3_H72IAed12gK9S_R7zEj7Dxb66vfLUDlE8yK7a50lO4BdOgS4tPZcY9TU
cA5iWzHiPVtXcvr9dga8K3dHm6a75vzyfFDU2DcB630PPWBu8IJoGUdVZKRF
TrcmQkH4W4rXLT2rixMaNDkLCPIZxHzpo9raSYsLayElyLLeJciCvguqtbfv
CpmGFuRYAxoFH49-_LO3vl4DSSGENleRoxAUpAIevoBl4KCpTacEZ9xHLMLw
IHFYr1Unj3GWZiAidjQaSFD8Me4uGM7tXbYt_RJUAhFb9O-xmHIrOHgWNhsh
icxG8rAH-kkgycoDF5tYlv-4UTsQtkffgWGK8PltToYgDfSfL_b0ah42qg==
Categories: Posts Tags: , , , ,

VB gotcha: when If function isn’t equivalent to an If-Then-Else block

Just got bitten by the following:

Dim takeN As Integer = If(Integer.TryParse(EdTake.Text, takeN), takeN, itemsCount)

I had used that instead of writing in 2 lines:

Dim takeN As Integer

If not Integer.TryParse(EdTake.Text, takeN) then takeN = itemsCount

However, there’s an important difference:

“If” is a function, so its arguments are evaluated at call-time. The “If” signature is:

image

I guess the default is to pass arguments ByVal (by value) and not ByRef (by reference), although I’d expect the signature to specify it explicitly to avoid confusion. When one passes a literal value (say 15) to TruePart or FalsePart it just gets “boxed” into an Object, whereas if one passes an expression (e.g. “takeN+1” or even just “takeN”) it gets evaluated first, then result is boxed and passed as an Object.

So, whereas one might think (esp. if coming from the ALGOL “Call-By-Name” era) the 1st line to be equivalent to:

Dim takeN As Integer

If Integer.TryParse(EdTake.Text, takeN) then takeN = [RESULT OF TRYPARSE] else takeN = itemsCount

in fact it’s equivalent to:

Dim takeN As Integer

If Integer.TryParse(EdTake.Text, takeN) then takeN = [ANY] else takeN = itemsCount

where ANY is whatever the takeN variable one had defined contains.

I thought the VB compiler was warning when using a variable before having assigned a value to it, but it seems in this case it misses to issue a warning. In fact I just tried:

Public ReadOnly Property Take As Integer
   Get
     Dim takeN As Integer
     Return takeN
   End Get

End Property

and it still doesn’t complain. Strange, probably it sets new local variables to 0 by default, but it shouldn’t encourage a programming style that relies on implicit default values – such syntax usually means there’s a mistake in the source code that can lead to a nasty bug.

The moral of the story? Avoid such shorthand expressions and stick to classic keyword-based syntactical structures – after all structured programming had been introduced as an alternative to the many times incomprehensible programs written in functional programming languages (e.g. due to overuse of nested function calls).

Zune window preview at Win7 taskbar acts as mini-player with rating

image

Just noticed a nice little touch by Microsoft at Zune player when running on Windows 7. When you move the mouse cursor over the running Zune application button on the taskbar you see a mini-player in the preview window that pops up. It even has a “heart” button there to rate the current song as a favorite one (full heart) or one you dislike (broken heart). Note that songs rated as dislikes can be configured at Zune settings to not sync with external portable devices.

There is one bug there though, it only shows the album/song title (alternating at every popup of the preview [the taskbar previews are live window previews btw on Windows 7]) if the Zune application is minimized. Else it doesn’t show the title at the top of the preview window.

Twitter bug calls you a moron?

Now who has to be more clever? Me or the Twitter programmers who apart from not being polite have managed to fail in simple character counting?

They have added automatic link shortening if your message exceeds 140 chars, but fail to count the resulting chars correctly and allow you to press the Tweet button which results in you seeing a message expressed in a quite insulting style.

 

image

Categories: Posts Tags: , , ,

IE9 RC bug? page changes IE back/forward colors and prepends icon, maintained for window session

image

Strange IE9 RC bug: visited http://www.vodafone.gr/portal/client/cms/viewCmsPage.action?pageId=0515 (via http://bit.ly/vodafone1kai1_xatzigiannis) and then clicked back several times seeing the above strange back/forward buttons (red color) and a Vodafone icon prefixed before them! Closing the window fixed the issue.

Are they using some hidden feature of IE9? Didn’t manage to reproduce the behavior though. If you have more info on this issue, do add comment below.

UPDATE: I think I found the culpit, drag-dropping the page icon from the address bar onto the desktop with IE9 RC doesn’t create a URL shortcut (.url file) as it used to be at IE8, but creates a pinned site shortcut (.website file) and immediately closes the tab/page and reopens it in a new window with the UI appearance shown above (back/forward button colors depend on the page icon dominant color I think). Totally non-intuitive (esp. breaks the rule of “least user surprise”), plus much more slower. Read more on this at https://zoomicon.wordpress.com/2011/02/16/more-ie9-rc-issues-tale-of-two-internet-shortcuts/ (also reported as an issue to Microsoft Connect at https://connect.microsoft.com/IE/feedback/details/644557/drag-dropping-page-icon-from-address-bar-to-the-desktop-issues)

Categories: Posts Tags: , , ,

Remove older crippled Google Search Provider from IE9 RC

Just installed Internet Explorer 9 (IE9) Release Candidate (RC), found the link at:

http://www.zdnet.com/blog/hardware/internet-explorer-9-rc-available-for-download/11349

Was amazed by it’s performance and clean GUI (especially the choice to move the yellow warning bar to the bottom and make it of smaller width than the browser window in order to be more noticeable). Do visit http://www.beautyoftheweb.com to explore IE9’s potential (and try the billiard game at http://agent8ball.com to see the graphics hardware acceleration).

However, when typing at the address bar (now combined with the search bar since new users were mixing them up and typed URLs at the search bar with unexpected outcome) the suggestions dropdown was showing two Google icons and one Bing.

Then I also noticed that one of the Google icons (the one that was already selected), didn’t allow me to turn on suggestions (send keystrokes to search engine as you type for dynamic search/suggestions).

The suggestions dropdown window just had an “Add” button that takes you to a page with more search providers to add, but no button to allow you to edit those search providers. So I right clicked the empty area at the right side of the address bar and selected to show the “Command bar” (means menu bar).

image

 

Then at menu “Tools”, I selected “Manage Add-ons”

image

 

There as you can see at the screenshot above (grabbed with ALT+PRINTSCREEN button combination and pasted into Windows Live Writer), the item selected says “Top Result Search” and has “Not Available” and also the “Top Result search address” field says the same. Also noticed in was using “google.gr” whereas the other google icon was using “google.com” and had all search address fields filled-in.

So I reckoned I should remove that problematic entry.

A thing I don’t get is those UIs that don’t allow you to press Remove button at a Default choice and force you to first set another one as default, then they enable the remove button. Totally non-intuitive for new users of computers. They should instead prompt you to select other default after you press Remove on the current Default one. If you must always have one entry there they should just disable remove when list item count is just one.

To keep it short, I clicked Bing as the Default search engine by selecting it and pressing “Set as Default”, then clicked the problematic Google search entry and selected “Remove” (the remove button was now available since it wasn’t the default search anymore).

The clicked “Close” and all was fine with search suggestions for both Bing and Google, plus got rid of that 2nd Google icon at the search suggestions drop-down window.

Categories: Posts Tags: , , , ,

Bug: Google Maps rendering exotic place names onto Patras, Greece

GoogleMapsRioArabia

Seems that day (8 Aug 2010), Google Maps system had been drinking or something, else I can’t explain how “Cara Oasis” and other exotic place names (in Arabic script?) were rendered onto a map for the outskirts of Patras, Greece.

Categories: Posts Tags: , , , ,

Bug: “The disk is full” at base.bundle.js of #NewTwitter

twitter-big-diskfull

Sometime ago I got the above error screen (after clicking on the error notice at the statusbar) on IE8/Vista at the new Twitter UI (aka #NewTwitter). Exactly what does “The disk is full.” error mean to say? Wonder if twimg.com (probably used to host images served by Twitter like avatar images) was itself running out of disk space and this was some error string returned via AJAX or if it’s some silly error message (maybe cause their code thought IE8 supports HTML5 local storage or something).

Maybe they’ve fixed it now, but in general even the classic Twitter UI didn’t seem to always play ok with IE8, e.g. Retweet didn’t always work (would see “Error on page” at the bottom) and you had to click on “x minutes ago” under a given status update to go to a page where you could retweet it…

Categories: Posts Tags: , , ,

Bug: Microsoft Office (2007) Diagnostics misleading summary view

Office2007_Diagnostics_Summary_FakeSuccess1

Office2007_Diagnostics_Summary_FakeSuccess2

At Office (2007) Diagnostics tests I’d expect more fine-grained status codes (rather than a mere “Completed”) so that the Summary view wouldn’t mislead you to think all the identified problems have been corrected. After all not many people would click on the “Detailed results” based on the falsely positive summary as pictured above.

Categories: Posts Tags: , , ,
%d bloggers like this: