Author Archives: Yuriy

Shorten URL in HelloTXT WordPress plugin

HelloTXT is a very cool service that can post your updates to multiple social networks with a single click. You can feed it data in multiple ways from RSS feeds to Android phones. One such way is a small neat WordPress plugin by Matthew Phillips. Once installed in your blog it will ping HelloTXT whenever you write a new post, notifying all your connected services from Facebook to Twitter.

One small drawback of v1.0.1 of this plugin (current as of this writing) – if permalink URL of your post is very long (pretty ones tend to be) – it gets cut off during HelloTXT notification, since status update has to be within 140 characters length. But there’s an easy solution. Open PHP source of the plugin in any text editor and in function hellotxt_notification locate line:

$link = get_permalink($post->ID);

This is the line that gets permalink of your post. To replace it with shortened URL we can call API of TinyURL service:

$link = file_get_contents("http://tinyurl.com/api-create.php?url=".get_permalink($post->ID));

and Voila! short links are being sent to HelloTXT

Kindle Fire as an Android Tablet

Got my Kindle Fire. I must say – I love everything about this device. It’s fast, powerful, with a very nice screen. There’re gazillion reviews out there, I am not going to repeat them, just mention what I did to make it truly perfect.

Since Fire is powered by Android OS there’s no limit to what can be done with it.

Amazon Kindle Fire as an Android TabletFirst, I rooted it. Mostly I did it so I can install Android Market. Amazon’s own AppStore is nice and all, but very limited comparing to Android Market (even if it has Market’s apps, usually they’re a few versions behind). Beware though – if you root your Fire, you will lose video streaming capabilities from Amazon, so what I did – rooted, installed Market, unrooted (luckily it’s a one-click operation with rooting app).

Second, even though I like Fire’s home screen with the carousel and everything, I am used to more traditional Android display, so I installed ADW Launcher and got 5 home screens, app drawer and all the bells and whistles. And still kept all Fire capabilities (Amazon video, music & books) via pre-installed apps, now available in app drawer.

And last, I installed Dolphin Browser HD to use instead of preinstalled Silk web browser, since Dolphin is much more capable, and superb FBReader to read my own collection of ebooks. Those two apps are permanently docked in my home screen.

I could go on and on, about how you can stream your own music and videos from your home PC via GMote app, how you can now install GMail, YouTube and any other Google app etc. etc. but that would take forever. The conclusion: Fire is an Android tablet and capable of anything Android Tablet can do.

Plants vs. Zombies 2!

Well, not really. But if you’re a fan of the original PvZ and just can’t wait for the sequel – check out this beauty:

“Mini Robot Wars” looks like a straight out clone of Plant vs. Zombies, but as clones go – this one is pretty good, give it a try!

UltraWebMenu: When background doesn’t change on hover in IE9

If you tried to use Infragistics classic UltraWebMenu control in IE9 you may experience issue (even in the latest version, 11.2 at the time of this post) whereby menu items don’t change background on mouse hover even though background is specified in menu’s HoverItemStyle property.

The solution is specify BorderStyle in HoverItemStyle. It can be any value besides NotSet, but the actual attribute has to be there. So for example if you want your hover style to have no borders and your original style looks like:

<HoverItemStyle
   ForeColor="White" 
   BackColor="#81C0E9"
   Height="18px"
   BorderWidth="0px"> 
</HoverItemStyle>

change it to

<HoverItemStyle
   ForeColor="White"
   BackColor="#81C0E9"
   Height="18px"
   BorderWidth="0px" 
   BorderStyle="None">
</HoverItemStyle>

I don’t know why border style affects showing of the background, but there you have it. Adding BorderStyle to HoverItemStyle will enable displaying of background color on hover.

VB for Android

Found this gem today:

Basic 4 Android

It’s a Visual Basic IDE environment for developing Android apps. But unlike other similar solutions it does not require bloated runtime running on the device, Basic4Android easily compiles native APK app.

Don’t learn Java, utilize your existing Visual Basic skills instead. And the community of thousands of developers can be a huge help as well.

Also you’re in luck today. Download the trial, play around with it and if you like it – use discount code “bvqbet” to get 50% off any version! Here’s how:

  1. Visit purchase link: http://www.basic4ppc.com/android/purchase.html
  2. Select Plimus as your checkout option
  3. Enter coupon code bvqbet in the coupon code field
  4. Profit! You get a 50% discound off a regular price

Happy coding!

UltraWebGrid bug: Row is selected on mouse move

Submitted for your approval an UltraWebGrid with CellClickActionDefault=”RowSelect” and SelectTypeRowDefault=”Single” – an ordinary down-to-earth grid. It also posses event handler AfterSelectChangeHandler, also nothing out of the ordinary. But in a minute the aforementioned grid will exhibit properties most unusual. As the alert message ahead reads: Infragistics Bug Continue reading →

ClientScript.RegisterStartupScript: script injected, but not executed

This was one weird mystery. I have used ASP.NET’s method ClientScript.RegisterStartupScript countless times to inject client-side JavaScript into page’s markup from the server-side code and it always worked perfectly. This time I created a very basic page from scratch:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>My Page</title>
    <script type="text/javascript" src="script1.js" />
    <script type="text/javascript" src="script2.js" />
    <script type="text/javascript" src="script3.js" />
</head>
<body>
    <form id="xfrmMain" runat="server">
    </form>
</body>
</html>

And then injected client-side script into it:

ClientScript.RegisterStartupScript(Me.GetType, "JSCode", "ProcessData();", True)

where ProcessData() is function from one of the scripts, loaded in the HEAD tag. The script injected just fine, I got a beautiful insert at the bottom of the rendered page:

<script type="text/javascript">
//<![CDATA[
ProcessData();//]]>
</script>

The problem was – it didn’d do squat – the script did not execute. Why? Continue reading →

How to load IFRAMEs in order according to priority

Let’s say you have a Web page that displays “widgets” a small islands of information. And internally those widgets are IFRAME elements, whose source is loaded dynamically from the same server at runtime in client side JavaScript. So, you have a code similar to this:

var aIframes = document.getElementsByTagName('IFRAME');
for (var I = 0; I < aIframes.length; I++) {
    aIframes[I].src = aIframes[I].getAttribute('originalURL')
}

This (oversimplified) code assumes that URL for IFRAME source already stored as a custom attribute ‘originalURL’ of IFRAME element (for example placed there by server-side code), but it can equally come from other sources. This approach is usually taken so IFRAMES can initially display a static page with “Please wait. Loading…” animation meanwhile dynamically loading real data – creates a better user experience.

The code loops thru all IFRAMEs setting their SRC attribute, displaying content, so you would see something like

IFRAME widgets

It’s all well and good, but there’s a small problem. SRC of IFRAMEs is assigned in order of their appearance on the page and if URLs are pointing to the same server and one of the earlier IFRAMEs takes a long time to load – it will block the rest of the IFRAMEs from loading. Continue reading →