Saturday, February 13, 2016

Android 5.0: how to change recent apps title color?


I build android apps using Cordova and it is great. I wanted to change the Title color bar when you view you resent apps on android 5.

I spend quite some time trying to figure this out as I know little about the android development ways but always keen to learn so this is how I managed it:

Under your platforms > android > res folder add a new "values-v14" folder. Add a themes.xml file to the folder:




Now add your colors.xml under your values folder:



Now go to your AndroidManifest.xml file located under the platforms > android folder and change the android:theme attribute to android:theme="@style/MyAppTheme" :



Run the cordova CLI: $ cordova run Android

And awesome we have a custom colored title.

Tuesday, March 10, 2015

Visual Studio 2013 Crashing

I am used to VS so I tried opening a project that I scaffold using yeoman. But to my surprise VS just crashes when I open the project as a website.

I had a feeling it has something to do with the node_modules folder, to test I deleted it and VS loaded the website for editing. The next thing was: how do I load the website project without that node_modules folder?

The only thing I could find that works is to set the “Hidden” attribute for the node_modules folder.

  1. Open Windows Explorer. 
  2. Right click the node_modules folder which you want to exclude, and then select “Properties”.
  3. Check the “Hidden” attribute.

You can now open the website in VS and it will not load the node_modules folder. Problem solved for now.

Tuesday, November 19, 2013

Typeahead with Angular

I wanted to build a small mock up to test if I can use the Typeahead (ui.bootstrap.typeahead) in angular-ui 0.6.0.

But I am using Angularjs 1.2.0 and Bootstrap 3


I just created a build with just the Typeahead, and added the resulting tpls script to the plunk.

I also wanted to test if I can add my own embedded template for a combined view of the records. It turn out with the $templateCache it is easy,


All is working so its good!

Thursday, October 25, 2012

Some IE9 Grief!

Today I really hated IE9 even more!

 

I had this ajax:

    

    $.ajax({

        type: "GET",

        url: "Reportviewer.aspx/GetSomeData",

        contentType: "application/json; charset=utf-8",

        data: "{}",

        dataType: "json",

        success: AjaxSucceeded

    });

    function AjaxSucceeded(result) {

        console.log(result)

        $(result.d).each(function () {

            ...

        });

    }

 

In IE9 the ajax just don’t want to call the success function “AjaxSucceeded” but in Crome, Firefox it returns just fine.

 

After googeling like crazy I found out all instances of console.log() need to be removed from your script in order for it to work in IE9 without it being in developer mode.

 

Well now I know!

 

 

Tuesday, October 16, 2012

Sum(First(…)) not allowed limitation in SSRS

I have been struggling with an issue in SSRS for some time now and finally solved the issue:
The Issue
I have this data:
In the report I want the ROWS and COLUMNS to be dynamic, adding a matrix table to the report and setting the ROWGROUPS to the rows and ColumnName to the Columns and Value to the Details:
When running the report it displays correctly:
Now I want to add the AREA to show the ROWGROUPs fictional areas, I only want to show the AREA for each ROWGROUP and not the sum :
So not  but
This displays correctly:
Now I want to add a Total at the bottom, the issue here is that ssrs sums the AREAs like such:
The Solution
One way of getting the correct total of the AREA column is to add 2 new columns to our sql query:
SELECT Test.*
       ,ROW_NUMBER() OVER (ORDER BY ROWGROUP) AS 'RowNumber'
       ,RANK() OVER (ORDER BY ROWGROUP) AS 'Rank'
FROM   Test

and using an expression on the AreaTotal:
=Sum(IIf(Fields!Rank.Value = Fields!RowNumber.Value, Fields!AREA.Value, 0))

Producing the desired result:

Friday, March 30, 2012

Label ContentStringFormat

Again this morning struggled with something I knew I had struggled with before this time I am in WPF XAML trying to set a StringFormat on my binding to get it formatted as a 2 decimal:

<Label Content="{Binding SelectedObject.DoubleNumber, StringFormat=N2}"/>

Running my view it is not showing me what I want to see; in this case showing 17.877651246, then I suddenly remembered that the Label control has its own way of dealing with StringFormat with the ContentStringFormat property:

<Label ContentStringFormat="N2" Content="{Binding SelectedObject.DoubleNumber}" />

The view is giving me 17.88 awesome!
I hope I remember this now actually makes a bit sense; I am setting the Content so setting the  Content => StringFormat .. aah

Thursday, March 29, 2012

Find and Replace using regular expressions

Decided today to take my Find and Replace up one notch:
I got this code:
var parameters = new
{
        labSoilAnalysis.ID,
        labSoilAnalysis.Year,
        labSoilAnalysis.Season,
        labSoilAnalysis.RegionID,
        labSoilAnalysis.FieldID
};


that I want to change to:
var parameters = new
{
        ID =  labSoilAnalysis.ID,
        Year = labSoilAnalysis.Year,
        Season = labSoilAnalysis.Season,
        RegionID = labSoilAnalysis.RegionID,
        FieldID = labSoilAnalysis.FieldID
};

Using regular expressions I ended up using:

The expression in the find box: {labSoilAnalysis}{.}{.+[^,]} is 3 tag expressions that is each assigned a number that I use in the Replace box, to reorder the code.

I know that it can be done in a beter way but me being a newbie to regex… maybe some of the big guns can help to make it beter, please post a comment with your take!