Archive for October 8th, 2009

Programmer Symbology

Have you ever taken a step back and looked at all the funny characters we use in programming computers?

I did this yesterday. Sometimes, when you look at familiar things in just the right light, they seem so strange.

strange things on the menu

I use the period to terminate all my sentences. In many programming languages the period is more of a continuation character. It says: “I’m going to act on this thing, and here is what I want it to do”.

boss.MakeMeASandwhich();

That code uses a semicolon to finish a statement; in writing the semicolon joins independent clauses. If symbols are so powerful, how can we juggle the conflicting meanings in our mind? Maybe Perl and C++ had part of it right using –> as a dereferencing operator.*

Sometimes a symbol will mean different things depending on how many times you type it. Like & versus &&. Or the = in JavaScript:

var x = 3;    // assignment

if(x == "3")  // check for equality

if(x === "3") // check for equality and i really really mean 
              // equality because i typed an extra = character

Then we use symbols that impart meaning due to their shape. 

{
    // i'm trapped inside a { } and I can't escape.
}

It’s really not a far stretch from using { } to creating ASCII art.

$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$'`$$$$$$$$$$$$$'`$$$
$$$$$$  $$$$$$$$$$$  $$$$
$$$$$$$  '$/ `/ `$' .$$$$
$$$$$$$$. i  i  /! .$$$$$
$$$$$$$$$.--'--'   $$$$$$
$$^^$$$$$'        J$$$$$$
$$$   ~""   `.   .$$$$$$$
$$$$$e,      ;  .$$$$$$$$
$$$$$$$$$$$.'   $$$$$$$$$
$$$$$$$$$$$$.    $$$$$$$$
$$$$$$$$$$$$$     $by&TL$

In fact, I think you could get the above picture to compile into something useful in APL.

* It’s amusing that the Wikipedia entry for Dereference operator has a single “See also” link at this time, and that link points to Segmentation fault.


jQuery Plugin For Collecta Powered Realtime Related Stream Bar

This jQuery Plugin allows you to create a bar of real-time stream of information related to your post powered by Collecta search engine. Collecta monitors the streams of news sites, popular blogs and social media. So it can show you results as they happen.

Collecta provides streams of information from a wide variety of sources in five content categories: updates, stories, comments, photos, and videos. Implementation is really straight forward and you can easily customize the look of tweet bar using CSS. Realtime Related Stream Bar jQuery Plugin supports many arguments, all of which are optional.

Features

  • Show realtime related stream of information based on your post tags.
  • Collecta provides streams of information from a wide variety of sources. you can choose from 5 categories of content: updates, stories, comments, photos, and videos.
  • Search by tags in OR or AND operators.
  • You can also search using a custom query (Fixed query or based on user input).
  • Many transition options like opacity, height, font-size.
  • Each part of the result -avatar, author name, link- has its own class for easy style customization.
  • Show or hide some parts of the results like avatar, author name, date.
  • Use a typical JS call or auto-load div elements that have “related-stream” class.

Developed by Mike at MoreTechTips; this jQuery plugin is available for download under Apache License.  You can find further information, demo & download on Realtime Related Stream Bar jQuery Plugin’s Website.

Similar Posts:


Gearing up for PDC 2009 – Platinum Sponsors

We’re getting ready for the upcoming Microsoft Professional Developer’s Conference 2009.

DX_PDC_large

If you’re attending then you’ll be in for treat because we’re bring the big booth with us. This means that we’ll have a bunch of the DevExpress crew there to answer your questions and give demos. And we’re also planning to have a little bit of fun for you.

The logo on the left reveals a little bit of the the theme that we’ve got planned for you.

Can you guess what the theme might be?


Twig: Flexible, Fast, and Secure Template Language For PHP

Twig is a modern template language for PHP 5.2+ that is flexible, fast, and secure. It supports everything you need to build powerful templates with ease: multiple inheritance, blocks, automatic output-escaping, and much more.

The syntax is easy to learn and has been optimized to allow web designers to get their job done fast without getting in their way. If you have any exposure to other text-based template languages, such as Smarty, Django, or Jinja, you should feel right at home with Twig. It’s both designer and developer friendly by sticking to PHP’s principles and adding functionality useful for templating environments.

Key Features

  • Fast: Twig compiles templates down to plain optimized PHP code. The overhead compared to regular PHP code was reduced to the very minimum.
  • Secure: Twig has a sandbox mode to evaluate untrusted template code. This allows Twig to be used as a templating language for applications where users may modify the template design.
  • Flexible: Twig is powered by a flexible lexer and parser. This allows the developer to define its own custom tags and filters, and create its own DSL.

Twig is brought to you by Fabien Potencier, the creator of the symfony framework. Twig is released under the new BSD license.. You can find further information, documentation & download on Twig’s Website.

Similar Posts:


Application that won’t Pin to Taskbar in Windows 7

Ok, so I have one of my applications (Html Help Builder) that will not pin to the taskbar in Windows 7. This is an application I’ve created and have full control over in terms of build, but I can’t figure out why it will not pin to the Windows 7 taskbar. All other applications pin just fine, but this particular one will not pin or be dragged onto the taskbar. Not from a running application, not from a dragged shortcut or by using the context menu to pin it to the taskbar. The Task menu that pops up has nothing more than a Close this Application on it instead of the usual pin options.

NoPinContext

Notice that this looks very different from a typical application which shows the actual application instance(s) running plus the Pin this program to taskbar:

PinWorking

I also have this application hooked to a shortcut on the desktop and the desktop shortcut also doesn’t have a Pin to taskbar option like all other icons.

As far as I know there’s nothing particularly special about this application. It’s an EXE launched from either a shortcut or directly from Explorer and it just will not pin. Since this is a distributed application I also installed it on another machine with exactly the same result. The context menu has no pinning options and I can drag the shortcut onto the taskbar either.

This is an old FoxPro based application that uses the Visual FoxPro 9.0sp2 runtimes. Now some of you will jump on that and say “Aha!” – but that’s not it. I have several other applications that are configured pretty much in the same way – and they run fine and have perfectly fine pinning options. In fact the second screen shot you see is another FoxPro EXE application run off a shortcut. And it appears to be working just fine.

So it appears it’s something inside the application that is causing this to occur.

It’s the Filename, Stupid!

So imagine that prior to this section I posted about 10 bullets of things I’d tried that didn’t work to solicit some feedback, when I ran across a Technet post with another guy who had an application named documentation.exe that didn’t work. It was explained to him that there are a few ‘reserved’ words for EXE names that are treated special. documenation.exe was a bad name – and bad names don’t get proper taskbar representation. Bad exe – go stand in the corner!

Windows has a few reserved names that include things like Documentation, Help, Setup, Readme etc. that are not pinned to the taskbar. These are exceptions in Windows (sorry, I couldn’t find a link that provides a complete list).

I dismissed that Technet post initially when I ran into it because the name of my EXE is pretty unique: wwhelp.exe. Not exactly a name you would expect to be on any sort of exception list. But it turns out the rules in Windows aren’t exact matches, but it looks for anything that contains these names. So anything that contains the word Help in the EXE name is considered a special item (presumably a help file).

So I renamed my file to HlpBuilder.exe and lo and behold – I get my Pin to taskbar back and all windows show up on the task context menu. It gets even better though. If I rename the EXE I do get the Pin to taskbar option, but if I create a shortcut and name it West Wind Html Html Help Builder the shortcut again has no  Pin to taskbar option and I can’t drag it to the taskbar. Apparently if the reserved word appears in the text of the shortcut it too is limited in functionality.

Man, how retarded is that? If an EXE file contains any of these reserved words it won’t pin? If the Shortcut Text contains one of these reserved words it won’t pin and generally work incorrectly? Really? Why have an arbitrary exception like that? That’s making an awful lot of assumptions and this is likely to break a number of application and they’re standard Windows behavior. This is an EPIC design failure on Microsoft’s part.

It looks like my only alternative is to rename the main EXE. I’m not really married to wwhelp.exe (how old skool of me – uh, this app is going on 15 years)Unfortunately it’s not quite as simple as that. There are update routines in a separate application that have the filename hard coded (and which doesn’t update at customers) and since the EXE is a COM server it needs to be re-registered. An EXE change basically requires a full reinstallation of the product instead of the normal update process I use.  But I don’t know what to do about the shortcut. I can’t just erase Help from the name of the shortcut since it’s the freaking product name.

<sigh> It’s never easy on the Windows platform is it? How I hate building desktop apps these days, but this is one app that wouldn’t work well as a Web UI unfortunately.

© Rick Strahl, West Wind Technologies, 2005-2009
Posted in Vista  Windows  
kick it on DotNetKicks.com


  • Sponsored Links

  •  

  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress