Wednesday, March 25, 2015

iOS - Must Know Features

On all iOS devices:
1. Shake to erase current edited text
2. Change time zone in settings/general when abroad
3. Add Chinese dictionary to translate the unknown words
4. Hold 123 key and move to the number to enter number
5. Say "hi Siri" in plugin mode
6. Turn off cell data access for apps to reduce the 3G/LTE consumption
7. Add Chinese calendar into your calendar


On iPad:
1. Multi-Fingers gestures

iOS - Yahoo Related Issues

I updated my iPhone 6 to iOS 8.0.2 and I lost both Yahoo inbox mail and also Yahoo Contact.

Apparently for people using second sign-in verification on Yahoo account, the regular password does not work. You have to use a one time password that is generated by Yahoo. These are the steps:
A. Use CardDav Method
https://help.yahoo.com/kb/mail-for-desktop/ios-devices-sln14840.html
1.     Tap the Settingsicon on your device's Home screen.
2.     Tap Mail, Contacts, Calendars.
3.     Tap Add Account.
4.     Tap Other.
5.     Tap Add CardDAV Account under "Contacts."
6.     Enter your:
     ·         Server (https://carddav.address.yahoo.com)
     ·         Yahoo ID
     ·         Password  (PLEASE DO NOT USE YOUR REGULAR YAHOO PASSWORD!!, PLEASE GO TO STEP B FOR THIS PASSWORD)
     ·         Account description
7.     Tap Next to complete set up.
It will take about 2 minutes to process then it would give you this window: Failed to process using SSL. Do you want to continue not using SSL?
I clicked continue and then it was success

B. To generate App Password. You have to login to your Yahoo account setting as follow:
https://help.yahoo.com/kb/yahoo-account/generate-one-time-password-sln15241.html


Generating Yahoo App Passwords


To protect your account, you're required to generate a one-time password, separate from your Yahoo account password, when you use non-Yahoo apps.

Here's how:

8.    First activate second sign-in verification on your account to use App Passwords.
9.    From your Account Info page, click App Passwords.
10.  Under "Generate new application password," enter the name of the app that requires a password.
11.  Click Generate Password.
Tip:
This isn't a new password for your account. It's a one-time password to validate you're authorizing access to your account from a non-Yahoo app.
12.  Enter the code into the password field of your mobile device.
13.  Click Done to reset the code generator.
-If you forget the code, you can always generate a new one.
You're now safely connected!
We'll save a list of apps within your "Generate app passwords" page. Also from this page, you can generate a new code or  remove permissions.

Hopefully this would help you fix the contact sync problem.
As at this moment I am still not able to get my Yahoo Mail sync to my iOS 8.0.2 Mail App. It was able to get the mail on the other folder, but inbox is EMPTY.
So somehow the inbox folder is totally BROKEN. Anybody can help me with this?
While waiting for the fix, I am temporarily using Yahoo Mail App which you can download it from Apple store.
Please help if you can sync Yahoo Mail.



Windows - A Low Disk Trigger on Windows 2008 Server

One simple way to get Windows Server 2008 to send low disk space e-mail alerts is to use Task Scheduler and the System Log. If the free space falls below the percentage specified in HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\DiskSpaceThreshold=dword:0000000a, an event is recorded in the System Log that can trigger a task to send an e-mail message.

1.    Open Task Scheduler and create a new task.
2.    Enter a name for the task, select "Run whether user is logged on or not", and check "Do not store password."
3.    Add a new trigger on the Triggers tab.
4.    Select "On an event" in the "Begin the task" box.
5.    Set Log to "System", Source to "srv", and Event ID to "2013".
6.    Add a new action on the Actions tab.
7.    Set Action to "Send an e-mail" and fill in the rest of the settings appropriately.
8.    To configure when the low disk space event is recorded in the System Log, open the Registry Editor, navigate to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and add a DWORD value named “DiskSpaceThreshold”, setting it to the desired percentage. When the entry does not exist, the default value is 10.


SSRS - How to Eliminate Merged Cells Issue When Exporting Report to Excel

This is very simple actually - just make sure the width of every cell has only maximum of 2 decimal places and last digit is either 0 or 5.  For example: 2.5 or 2.75 instead of 2.453 and 2.7501. (always land the number on a 0.05 multiple)

MSSQL - How to Check A Numeric Value


Here is a quick script (forgot where I found it) to check a given value is a numeric value:

CREATE FUNCTION dbo.isReallyNumeric
(
    @num VARCHAR(64)
)
RETURNS BIT
BEGIN
    IF LEFT(@num, 1) = '-'  SET @num = SUBSTRING(@num, 2, LEN(@num))

    DECLARE @pos TINYINT

    SET @pos = 1 + LEN(@num) - CHARINDEX('.', REVERSE(@num))

    RETURN
    CASE WHEN PATINDEX('%[^0-9.-]%', @num) = 0
          AND @num NOT IN ('.', '-', '+', '^')
          AND LEN(@num)>0
          AND @num NOT LIKE '%-%'
          AND (((@pos = LEN(@num)+1)
           OR @pos = CHARINDEX('.', @num)))
         THEN 1
         ELSE 0
    END
END


GO  

However, I think it is a lot easier and powder if we just install RegEx CLR and use it to check for numeric pattern.

SSRS - Repeat Header Section for A Tablix

How to repeat header section for a tablix:
    1. in the grouping pane, click on the small triangle and select "Advanced Mode" to show static members:


       
    2. verify that you have the properties grid turned on (in BI Development Studio use F4, in Report Builder go to the "View" tab and select "Properties")
       
    3. select the corresponding (static) item in the row group hierarchy
       
    4. in the properties grid:
      - set KeepWithGroup to After
      - set RepeatOnNewPage to true for repeating headers
      - set FixedData to true for keeping headers visible

SSRS - Adding Page Break

To add page break to a large result set: 

In your scenario, you want to display 10 records in each page, we can achieve it follow the steps below.

  1. Click the Details group in the Row Groups pane.
  2. From the Tablix member Properties pane, expand “Group”-> “PageBreak”.
  3. Set the “BreakLocation” to “End” and set the “Disable” property to the expression like below:  =IIF(Globals!RenderFormat.Name = nothing, IIF((rownumber(nothing) mod 30) = 0,false,true), true)  NOTE: this expression disable pagebreak when exporting.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/276acd62-49e7-41ad-a50e-7e4b97e44dcc/tablix-paging-in-ssrs

SSRS - To Drill Through A Report Using A Popup Window

Add the following code in the cell's expression:

="javascript:void(window.open('" + "http://SharePointServer/_vti_bin/reportserver?http%3A//SharePointServer/ReportFolder/ReportName.rdl" + "','Title','height=400,width=150,scrollbars=1'))"

SSRS - To See Report Execution History

USE ReportServer;

SELECT
      COUNT(Name) AS ExecutionCount
    , Name AS ReportName
    , MAX(TimeStart) AS ReportLastRun   
    , UserName AS ReportRunByUser
    , AVG(TimeDataRetrieval) AS TimeDataRetrieval
    , AVG(TimeProcessing) AS TimeProcessing
    , AVG(TimeRendering) AS TimeRendering
    , AVG(ByteCount) AS ByteCount
    , AVG([RowCount]) AS [RowCount]
    , MAX([Format]) AS [Format]
    , MAX([Parameters]) AS [Parameters]
FROM (SELECT
           e.TimeStart
          ,c.Type
          ,c.Name
          ,e.UserName
          ,e.TimeDataRetrieval
          ,e.TimeProcessing
          ,e.TimeRendering
          ,e.ByteCount
          ,e.[RowCount]
          ,e.[Format]
          ,SUBSTRING(e.[Parameters], 1, 200) [Parameters]
      FROM Catalog c
      JOIN ExecutionLog e
        ON c.ItemID = e.ReportID
      WHERE c.Type = 2) AS RE
WHERE
     UserName NOT LIKE 'DOMAIN\user1%'
AND UserName NOT LIKE 'DOMAIN\user2%'
GROUP BY
     Name
    ,UserName
ORDER BY
     ReportLastRun DESC
    ,ReportName
    ,UserName



RegEx - Useful Patterns

Description
RegEx Pattern
Sample Data & Result
Search for all numbers except ones prefixed with #
(?<!\#)\b\d{5,}\b

1234567-JUL13
Ck #1234567
145A1 12345 05/14.











Here is a good online tester: http://regexr.com

Quick Cheat Sheet: http://www.rexegg.com/regex-quickstart.html#quantifiers