• Home
  • About
  • Resume

Amazon Prime Instant Video is available on Android

By , 09/09/2014 9:17 AM

Amazon Prime on Android

Finally! Now Amazon Instant Videos (including Prime Videos) left the stale cradle of Kindles and Fire Phones and now available for generic android devices. If you have the Amazon shopping app – you can do a one time videoplayer install directly from it, or you can get it from Amazon App store. Details…

Amazon Prime Instant Video on Android

SAY NO TO FLASH!

By , 09/05/2014 9:21 AM

Say no to flash Just say no. And tell your kids never to use this piece of junk. And not only because its obsolete and has been replaced by HTML5 long ago. It also promotes bloatware and malware.

I got a prompt from my current Flash player that an update is available. So I ran the update – first it tried to download and install that bloatware of McAfee and only failed because connection to McAfee site failed. But that wasn’t all.

After install finished, I found that my browser was hijacked by “Trovi” malware – start page, search engine etc. And this was done by official installer from Adobe site! Wtf?!

Bye Flash, you won’t be missed.

Reenable (temporary) showModalDialog support in Chrome (for Windows) 37+

By , 09/02/2014 9:03 AM

You know you shouldn’t use showModalDialog to open modal windows – it’s bad taste and prone to cause issues. Unfortunately many applications (especially Enterprise ones) rely on the method ability to halt code execution until the window closed (e.g. user answers a YES/NO question).

Tough luck, starting version 37 Google Chrome removed support for showModalDialog. Your code suddenly began to act in weird and unpredictable way. You definitely should rework it to use a different approach to dialogs. Fortunately Google gives you a bit more time. You can re-enable showModalDialog support, but only temporarily – until May of 2015. Continue reading 'Reenable (temporary) showModalDialog support in Chrome (for Windows) 37+'»

Compare 2 source files and add difference to 3rd

By , 08/19/2014 2:53 PM

Beyond Compare 3-way merge

Sometimes when you patch or update your current version of software there is a need to apply the same changes to a previous version. Ordinary it’s a pain – you need to painstakingly determine which changes from the current source should go to previous version (because current source has changed a lot, new features added etc).

Enter Beyond Compare – coolest tool to do all kind of compassion. One of the best features – “3 way merge”. It allows you to compare 2 files and apply the difference to 3rd.

In our case here is what it can do:

  • Select new patched version of source file and compare it to old unpatched version
  • In menu select “Session –> Merge Files” – a middle pane appears that allows you to select 3rd file
  • In the middle tab select new unpatched version

That’s it! Beyond Compare will compare new patched and new unpatched version. If there’s a difference – those lines will be applied to old unpatched version. Otherwise if both new versions are the same – old version keeps it lines, even though they’re different from new version.

It’s all performed automatically all you have to do in the bottom pane (where merge result appear) select the filename to save to and hit “Save”

How to search for Pebble app/watchface on the web

By , 08/14/2014 2:21 PM

Pebble smartwatch has a pretty good appstore that is accessible from the official app on your phone. But sometimes I want just to search for the app on the Web (big browser, keyboard/mouse – you know). Fortunately it is possible:

Pebble Google Search

Just enter “site:apps.getpebble.com” in your google search in addition to search terms and you will be able to get direct links to Pebble apps/watchfaces in the app store.

Pebble direct appstore link

Of course this has limited use at the moment – you can scroll thru app screenshots, read the description and that’s about it. Ideally this would behave same way as Google Play store does – allow me to install the app from the web directly to registered device.

Your move, Pebble.

Infragistics WebDataMenu delayed resizing in Chrome

By , 08/01/2014 4:36 PM

I encountered weird issue using Infragistics ASP.NET WebDataMenu control. If total width of top-level items was bigger than menu’s width and scrolling kicked in – Google Chrome browser produces unexpected results.

Consider following basic markup for Infragistics WebDataMenu:

<ig:WebDataMenu ID="WebDataMenu1" runat="server" Width="300px">
   <ClientEvents Initialize="myInit" />
   <GroupSettings Orientation="Horizontal" />
   <Items>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
      <ig:DataMenuItem Text="Root Item"></ig:DataMenuItem>
   </Items>
</ig:WebDataMenu>

It’s a pretty basic markup that defines 10-item horizontal menu with a limited width, so scrolling is enabled. Code in the Initialize event handler would handle some calculation based on menu dimensions and other items on the page would be affected by these calculations. Continue reading 'Infragistics WebDataMenu delayed resizing in Chrome'»

Infragistics WebDataMenu flashes unexpected color on hover

By , 07/17/2014 2:44 PM

WebDataMenu
Infragistics WebDataMenu ASP.NET control comes both with predefined stylesets and allows you granularly overwrite any of the styles. For example definition like this

<ig:WebDataMenu ID="xmyMenu" runat="server" StyleSetName="Office2007Blue"
                 CssClass ="topMenuStyle" >
   <GroupSettings Orientation="Horizontal" />
   <ItemSettings CssClass="itemCssStyle" 
                 HoverCssClass="hoverCssStyle" 
                 SelectedCssClass="selectedCssStyle" />  
</ig:WebDataMenu>

will create a horizontal dropdown menu in default “Office 2007 Blue” styleset but allows you to overwrite individual styles via exposed CSS properties.

Let’s take a look at hover style. Continue reading 'Infragistics WebDataMenu flashes unexpected color on hover'»

Infragistics WebDataGrid crashes if its total width over 32767 pixels

By , 07/14/2014 1:33 PM

When you’re dealing with Infragistics WebDataGrid and want to manipulate appearance of individual columns – there’s a handy Columns collection for that. Unfortunately it’s available only if you define columns at design time or add columns to it in code-behind. If your grid features autogenerated columns – the collection will be empty.

There’s a way to derive column info tho – and can be done from grid row. The example below uses grid’s PreRender event to capture first row from which columns are derived and their width set:

Protected Sub xmyGrid_PreRender(sender As Object, e As EventArgs) Handles myGrid.PreRender
   Dim oGrid As GridControls.ContainerGrid
   Dim oRow As GridControls.ContainerGridRecord

   oGrid = sender
   oRow = oGrid.Rows(0)

   If oRow IsNot Nothing Then
      InitGridColumns(oRow) 'passing 1st grid row to helper sub
   End If
End Sub

Sub InitGridColumns(i_oRow As GridControls.ContainerGridRecord)
   Dim oGridCol As GridControls.BoundDataField

   'looping thru row cells
   For I As Integer = 0 To i_oRow.Items.Count - 1
       oGridCol = i_oRow.Items(I).Column 'deriving column object from row cell
       oGridCol.Width = Unit.Pixel(CalculateWidthHere()) 'setting calculated width
   Next
End Sub

This works pretty well – that is until summary width of all columns combined hit’s 32K. If this happens – grid crashes:

Continue reading 'Infragistics WebDataGrid crashes if its total width over 32767 pixels'»

WebHierarchicalDataGrid binds to data twice

By , 07/14/2014 12:04 PM

Infragistics WebHierarchicalDataGrid offers a nice ability to custom load-on-demand data via its ContainerGridDataBinding event. It is very useful during paging or displaying grid children – you can make a DB call and provide data a just needed for current page or child.

But it has a drawback – if you need to programmaticaly sort the grid by manipulating SortedColumns collection – grid thinks it needs to rebind the data and is calling ContainerGridDataBinding event handler again thus making it execute DB call again – which is redundant and may hinder performance. In a typical scenario you have your binding code:

Protected Sub xmyGrid_ContainerGridDataBinding(sender As Object, e As GridControls.DataBindingEventArgs) Handles xmyGrid.ContainerGridDataBinding
   e.Cancel = True
   e.DataSource = MakeDbCallToGetCurrentData()
   e.SelectArguments.TotalRowCount = iTotalNumberOfRecords
End Sub

and somewhere else add sorting

Protected Sub xmyGrid_PreRender(sender As Object, e As EventArgs) Handles xmyGrid.PreRender
   xmyGrid.Behaviors.Sorting.SortedColumns.Add(sCol1Key, SortDirection.Ascending)
   xmyGrid.Behaviors.Sorting.SortedColumns.Add(sCol2Key, SortDirection.Descending)
End Sub

Sorting code in the second event handler is causing grid to perform second call to ContainerGridDataBinding. The solution is to move sorting code inside of ContainerGridDataBinding handler:

Protected Sub xmyGrid_ContainerGridDataBinding(sender As Object, e As GridControls.DataBindingEventArgs) Handles xmyGrid.ContainerGridDataBinding
   e.Cancel = True
   e.DataSource = MakeDbCallToGetCurrentData()
   e.SelectArguments.TotalRowCount = iTotalNumberOfRecords

   xmyGrid.Behaviors.Sorting.SortedColumns.Add(sCol1Key, SortDirection.Ascending)
   xmyGrid.Behaviors.Sorting.SortedColumns.Add(sCol2Key, SortDirection.Descending)
End Sub

Since at this point grid already bound to data – columns are already available. And since we’re inside of ContainerGridDataBinding – the call to it is not repeated.

Infragistics WebDataGrid stalls on paging large datasets

By , 06/25/2014 4:12 PM

A common scenario while using Infragistics WebDataGrid is to have an unbound column, whose cell’s value is determined at runtime in InitializeRow event, something like

Private Sub xmyGrid_InitializeRow(ByVal sender As Object, ByVal e As GridControls.RowEventArgs) Handles xmyGrid.InitializeRow
   '... some code
   e.Row.Items(0).Value = SomeCalculatedData
   '... some more code
End Sub

This works fine if you bind the grid to a small data set (and you should!) But if, due to circumstances out of your control, you bind it to a dataset with tens of thousand of records you might be screwed. Even if you enable paging (and you most definitely should!) you may find yourself living in a shotgun shack in a situation that changing page takes forever and eventually crashes. If you do – change the above line to

e.Row.Items(0).Text = SomeCalculatedData

note using of .Text property, which is String, instead of .Value which is Object. Since you’re assigning the calculated data for presentation only – no need to change underlying value – and this makes all the difference.

Panorama Theme by Themocracy