Monday, November 14, 2011

Notepad++:
1. Show white space & Tab characters
View->Show all characters, or View->Show White Space and TAB

Trim Trailing Space & Save

Macro > Trim Trailing and save

--- Map this to Ctrl S

Remove the trailing spaces

TextFX > TextFX Edit > Trim Trailing Spaces

Wednesday, October 26, 2011

Samsung Galaxy S II 2 - Wifi and 4G on at same time.


Problem is that Wifi and 4G are on at same time at home, but no data is downloaded.

Solutions that I have found on the web / customer support:

Solution A
1. Navigate to Setttings -> Wireless and network -> Mobile networks
2. Uncheck Use packet data
3. Wait for Wifi to reconnect
4. Re-check Use packet data
5. Wati for 4G to come on and then dis-appear


Solution B

This happens whenever there is an app running that requires 4G and can't communicate over Wifi, most likely the T-Mobile My Account app. Try launching it (to bring it into the foreground), press Home, and then go to the Task Manager app to kill it.

Solution C

You could also try Llama from the market and try the following - it has worked wonders for my battery as well.



Turn off T mobils contact sync

menu -> settings -> accounts and sync -> uncheck T-Mobil contacts

Ensure mobile data is not active when connected to wifi - here is how

Install Llama from the Android Market

Add an event called WiFi

Add condition: WiFi connected (any network)

Add action: Wifi Sleep Policy (never sleep)

Add action: toggle Mobile Data (off)

Add another event called WiFi Disconnected

Add condition: WiFi disconnected (any network)

Add action: WiFi Sleep Policy (Sleeps when screen turns off)

Add action: Toggle Mobile Data (on)

This will clear up the dual wifi 4g issue + save you some battery



Monday, July 18, 2011

How to get Mac Address for Nook II

How to get the Mac Address for Nook 2 (II)

Had to call product support for this, because the device does not let you cancel setup, to get to the Device Info.

1. Power Off (button on upper back)
2. Power On
3. Press and Hold lower right button
4. Press touch screen in lower left corner, then lower right corner

This displays the Device Info button on the screen.

Click it and you will have your Mac Address

Monday, July 11, 2011

Application Verifier Tips

Setup for !avrf

!avrf requires the symbol path to be setup correctly. Use the following commands to set your symbol path.

  • .sympath+ C:\Windows\System32
  • .sympath+ srv*c:\symbolscache*http://msdl.microsoft.com/download/symbols
  • .reload
  • !avrf

From: http://geekswithblogs.net/akraus1/archive/2010/06/25/140610.aspx

Wednesday, May 25, 2011

MSBuild Building multiple Configurations and Platforms at the same time

Here is a MSBuild project file that allows you to specify multiple configurations and platforms. The advantage of this approach is that you get a single report with all the build results.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Rebuild" ToolsVersion="4.0">
<ItemGroup>
<ConfigurationList Condition=" '@(ConfigurationList)' == '' and $(Configuration) != '' " Include="$(Configuration.Split(';'))" />
<ConfigurationList Condition=" '@(ConfigurationList)' == '' " Include="Debug" />
<PlatformList Condition=" '@(PlatformList)' == '' and $(Platform) != '' " Include="$(Platform.Split(';'))" />
<PlatformList Condition=" '@(PlatformList)' == '' " Include="Xbox 360" />
<TargetList Condition=" '@(TargetList)' == '' and $(Targets) != '' " Include="$(Targets.Split(';'))" />
<TargetList Condition=" '@(TargetList)' == '' " Include="Rebuild" />
<ProjectList Condition=" '@(ProjectList)' == '' and $(Projects) != '' " Include="$(Projects.Split(';'))" />
<ProjectList Condition=" '@(ProjectList)' == '' " Include="$(MSBuildProjectDirectory)\Test.sln" />
ItemGroup>
<Target Name="Rebuild" Outputs="%(PlatformList.Identity)">
<PropertyGroup>
<CurrentPlatform>%(PlatformList.Identity)CurrentPlatform>
PropertyGroup>
<MSBuild Projects="@(ProjectList)"
Properties="Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);"
Targets="@(TargetList)"
SkipNonexistentProjects="true"
/>
Target>
Project>

usage:
msbuild BuildProject.proj /p:Projects="ProjA;ProjB" /p:Configuration="Debug;Release" /p:Platform="XBox 360;Win32;x86" /p:Targets="target"
examples:
msbuild BuildProject.proj
-- this will rebuild default solution for Debug|Xbox 360

msbuild BuildProject.proj /p:Projects="Test2.sln;Test1.sln" ^
/p:Configuration="Debug;Release" ^
/p:Platform="XBox 360;Win32;x86" ^
/p:Targets="clean;build"
-- this will build everything

Using Custom section in app.config for Visual Studio 2010

Sample app.config:
<configuration>
<configSections>
<sectionGroup name="machineSettings">
<section name="apple" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>

<appSettings>
<add key="TestMode" value="false" />
<add key="sdpBatPath" value="e:\sdpack\sdp.bat" />
</appSettings>

<machineSettings>
<apple>
<add key="myKeyA" value="AAA"/>
<add key="myKeyB" value="BBB"/>
</apple>
</machineSettings>

Code:
// NOTE: this is a case sensitive lookup
NameValueCollection userConfig = ConfigurationManager.GetSection("machineSettings/" + System.Environment.MachineName.ToLower()) as NameValueCollection;


Trouble Shooting:

Could not find schema information for the attribute 'key'
This message can be resolved by changing the schema for the app.config:

  • Open Properties window
  • Open app.config in Visual Studio
  • Goto Properties window
  • Select Schemas
  • Edit the Schemas
  • Choose /add a new schema
  • In my chase adding DotNetConfig20.xsd worked.

Monday, May 9, 2011

Using Linq to filter SQL based on Lists (or arrays)

Here is handy way of filtering your results based on passed in lists, which can be null.

The key is to handle the empty list case in the where clause using list.Count == 0 || . This will allow you to generate the appropriate query

public List GetData(List Numbers, List Letters)
{
if (Numbers == null)
Numbers = new List();

if (Letters == null)
Letters = new List();

var q = from d in database.table
where (Numbers.Count == 0 || Numbers.Contains(d.Number))
where (Letters.Count == 0 || Letters.Contains(d.Letter))
select new Data
{
Number = d.Number,
Letter = d.Letter,
};
return q.ToList();

}