Thursday, 19 December 2013

How to ask questions in an interview

uses short, open-ended questions when you want elaboration, and
short, yes-or-no questions when you want to be pointed

e.g. What do you think?

try not to end every question with a series of possible answers

e.g. Do you think x, y, z, q, r or...

The #1 tip for asking better questions? Cut them off at the question mark.

Saturday, 14 December 2013

Split .ape file with .cue file

  • download foobar2000
  • download Monkey's Audio Decoder
  • install the Monkey's Audio Decoder component in foobar2000
  • open the .cue in foobar2000
  • use foobar2000's converter to split the files 
To convert to MP3, download Lame , and copy the files to any folder (e.g. C:\Program Files\Lame) and point foobar2000 to the folder.

Happiness

Happiness is not a destination but a day-by-day journey.

No Sound after upgrade to Windows 8.1 with Sound Blaster X-Fi Xtreme Music

Just reinstall the drive downloaded from Creative.  Drive version is 2.18.15.

Thursday, 12 December 2013

Life

The storms of our life prove the strength of our Anchor.

Friday, 6 December 2013

High Key Photography

A bright, white background creates a high energy, happy, and distraction free scene, perfect for pictures of your friends and family. Known as high key photography, this technique instantly cures problems with ugly backgrounds and focuses the viewer’s attention on your subject.

http://digital-photography-school.com/4-tips-perfect-white-background-high-key-photography

Wednesday, 4 December 2013

Teaching with Video

The whole post...

The 30-Second Summary

  • Know your audience: Learn what your audience struggles with and what they want to know more about and use it to inform your script. Set context around your video by mentioning clear prerequisites.
  • Keep it concise: Cut the fluff from your videos to keep the length manageable, and break down long content into digestible chunks so that viewers can self-navigate.
  • Planning matters: Spec out your video specifically for the online format, and prepare a script before shooting.
  • Quality is essential: You don't have to spend thousands of dollars on equipment, but good audio and a decent lo-fi studio setup with a backdrop can make your production feel much more professional.
  • Look at metrics that tie to your goals: Specific measurements like student projects can speak to the effectiveness of your teaching on an entirely different level than general analytics.
  • Good supplementary content: Supplementary materials, like quizzes, transcripts, ebooks, and PDFs, can be a differentiator for your course and help tailor to different learning styles.
  • Passionate instructors: Put someone who's actually an expert on screen, rather than hiring an actor.

Thursday, 28 November 2013

Darktable

Free Digital Darkroom Software for Mac and Linux

Darktable is a free and open source RAW converter for Apple Mac OS X and Linux users. Its name is formed from it serving the dual features of being a virtual light table for viewing images in bulk and a virtual dark room for processing your RAW files...

Review

Web Site

Lightzone

Free Darkroom Software for Windows, Mac, and Linux

Lightzone is a free RAW converter that is in a similar vein to Adobe Lightroom, though with some distinct differences. As with Lightroom, Lightzone allows you to make non-destructive edits to your photos, so that you can always return to your original image file at any time...

Review

Web Site

Using Table as layout in HTML 5

The HTML5 specification still recommends that you don't use tables for layout, but if you do, you should differentiate those tables from tables that are used for tabular data.

Features to Define Your Table as Layout or Non-Layout

Feature of Table Is a Layout Table?
<table role="presentation"> It probably is a layout table
<table border="0"> It probably is a layout table
<table cellpadding="0"> It probably is a layout table
<table cellspacing="0"> It probably is a layout table
Use of the CAPTION, THEAD, or TH elements It probably is not a layout table
Use of the headers and scope attributes on the TH element It probably is not a layout table
<table border=""> It probably is not a layout table
<table border="1"> It probably is not a layout table
Visible borders set with CSS It probably is not a layout table

Thursday, 14 November 2013

Study Your Children

The greatest gift you can give your child is not your riches, but revealing to them their own!
- Max Lucado

Friday, 18 October 2013

Windows 7 - missing LPK.dll

Issues:
  • having this error when I tried to open FireFox, IE and some other applications

Solutions:
  • in Save Mode
  • Open cmd "Run as Administrator"
  • enter "sfc /scannow"

Tuesday, 3 September 2013

Deliverance

We see Satan’s tricks and ploys, but God sees Satan tripped and foiled.

Monday, 24 June 2013

Snowflakes

Snowflakes are frail, but if enough of them stick together they can stop traffic.

Dell Inspiron N5040 Brightness Control not working with TeamViewer

Pressing the <Fn> and <F?> keys can only move up and down two levels and the screen is extremely dim...
  • Go to the Device Manager, open Monitors, 
  • right click on PnP-Monitor (Standard)
    • select Properties and check if the Manufacturer is "TeamViewer GmbH"
  • Uninstall this driver if it is the case and the system should restore the default monitor driver


Thursday, 13 June 2013

Loss

A man once went to a minister for counseling.

“I’ve lost everything” he bemoaned.
“Oh,” the preacher responded, “I’m so sorry to hear you’ve lost your faith.”
“No,” the man corrected him, “I haven’t lost my faith.”
“Well then,” replied the preacher, “I’m sad to hear you’ve lost your character.”
“I didn’t say that,” the man corrected.  “I still have my character.”
“Then I’m so sorry to hear you’ve lost your salvation.”
“That’s not what I said!” the man objected, beginning to lose patience.
The minister explained, “Well, you have your faith, your character, and your salvation.  Seems to me, you have lost none of the things that really matter.”

Wednesday, 12 June 2013

Friday, 17 May 2013

Delete hiberfil.sys in Windows 7

Control Panel
Power Options
Change plan settings (the selected Preferred plans)
Change advanced power settings
Allow hybrid sleep - Off

Run cmd as Administrator
Type "powercfg -h off"

The link provide detail info.

Tuesday, 14 May 2013

Detach a Process in Visual Studio and IE 10 javascript debug

Having an error after installing IE 10:
Attaching the Script debugger to process '[<ID>]' iexplore.exe' on machine '<computer name>' failed.  A debugger is already attached.

To detach this process:
  • Open the Processes windows (Debug, Windows, Processes)
  • Select the process (iexplore.exe with that ID), right click and select "Detach Process"

To fix the problem without detaching the process every time:
  • run the following in a command window: regsvr32.exe "%ProgramFiles(x86)%\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"
  • make sure run the cmd prompt as an administrator


FireFox Bad Request Error

Here is the link showing how to fix this problem:
http://timourrashed.com/how-to-fix-the-400-bad-request-error-message-from-a-website/

Wednesday, 8 May 2013

FireFox 18.0.1 stops working

First posted on Feb 2, 2013
I am not able to start FireFox after installing the latest version of Nvidia driver.  I can start in safe mode.  It is strange that I can start the winPenPack version of the X-FireFox (18.0.1).

I have tried to disalbe all the add-ons and plugins, this didn't work.

Solution
After I do a "clean" installation of an older version (301.42) of the video driver, finally, I can start FireFox again.

Update:
I forgot this problem and upgrade to 314.22, the problem is back...

New Solution
In safe mode, go to  Options, Advanced, General and uncheck the "Use hardware acceleration when possible."

Tuesday, 30 April 2013

Visual SourceSafe - show all checked out files


  • Go to View, Search, Status Search... (<Ctrl> S)
  • Select either all or a specific user
  • Select "Search Area" options (the first option is useless, select either second or third options)


Thursday, 21 March 2013

Install NuGet package manually

I accidentally (without checking the description) installed a new version of a package which is not compatible to the project and I cannot find the correct version from the NuGet Installer anymore.  I have a test project which contain the package.  Since I cannot install the package from the UI, I need to install it manually.

Open the Pack Manager Console (View, Other Windows) and type the following:
  • Install-Package <package name> -Source C:\Projects\<project name>\packages\
The package name will be the first part of the folder name before the version number.  For example, the package folder name is "MvcMailer.4.0" and the package name is "MvcMailer".

Web Application targets IE 9 and above...

Add this to the master page or the shard layout file, and IE will not go into the compatibility mode (IE 8)
  • <meta http-equiv="X-UA-Compatible" content="IE=9" />

A helping hand

"Do all the good you can, by all the means you can, in all the ways you can, in all the places you can, at all the times you can, to all the people you can, as long as you ever can."

John Wesley

Monday, 18 March 2013

Android download won't go away

Issue:
  • I have the Facebook download for a few days and even I uninstalled Facebook it won't go away.
Solution:
  • Go to Application and find Downloads
  • Click "Other Downloads", select the item, and click "Cancel"




Keurig problem - water flow back into reservoir

Press the hole and not stopping the water to come out. The water is not hot, check it, just in case.

Planning

If you fail to plan, you're planning to fail.

Friday, 15 March 2013

LINQ Zip and join

Add two list sequentially together according to it order... stop when end of one list.

Fast but limited compare with join.

(roleList).Zip(roleDescriptionList, (r, rd) => new RoleDescription() { roleID = r.dataID, role = r.dataValue, description = rd.dataValue }).ToList();

roleList and roleDescriptionList are two separate lists.  They can be unrelated at all.
Using Zip() to join them together to create a new list of object "RoleDescription" one by one.

To have better control, you should use join instead.


IList<RoleDescription> result = (from r in roleList
                         join rd in roleDescriptionList
                         on r.dataID equals rd.dataID
                         select new RoleDescription { 
                             roleID = r.dataID, 
                             role = r.dataValue, 
                             description = rd.dataValue }).ToList();

Wednesday, 13 March 2013

MVC Partial View

When having <script></script> in a partial view, remember don't use the @section Scripts {
} since the partial view has no Layout (i.e. you have this @{ Layout = null} on the top of the partial view.

Friday, 8 March 2013

Idempotent

Calling the function a million times has the same effect as one request.

Example:
WebAPI Uniform Interface:
  • GET, PUT and DELETE

Wednesday, 20 February 2013

MVC StringLength and maxlength

When you add the validation StringLength in MVC, it won't automatically limit the user to the max length.  You need to manually to add this in the View.

You cannot use @Html.EditorFor and you should use @Html.TextBoxFor.


<%=Html.TextBox("polNum",null, new {maxlength=10}) %>

@Html.TextBoxFor(model => model.homePostalCode, new { maxlength = 7 })

Wednesday, 13 February 2013

MVC Razor Html.ActionLink new page

@Html.ActionLink("More info...", "../newpage", null, new { target = "_blank" })

Cannot put the target option in the 3rd parameter, it will treat it as "?target=_blank".

Tuesday, 12 February 2013

jQuery UI Dailog, IE and DropDownList

There is a problem to select from a dropdownlist in a jQuery Dialog plug-in.  It happens only in IE (8 and 9, at least).  It works in FireFox.

  • The very first time (after opening the dialog) will work but it won't when I try to select another value
  • I can select the value using the keyboard
  • Tab to the dropdownlist and select with the mouse
  • I tired to add the z-index to the dropdownlist but it doesn't help
Solution:
  • The current solution is adding a mouseover event to set the focus to the dropdownlist.
onmouseover = "this.focus();return true;"


Relationship

“I’d rather do nothing with you than something without you.”

Monday, 11 February 2013

Relationship

Relationships don’t survive because the guilty are punished but because the innocent are merciful!

Tuesday, 5 February 2013

jQuery Template

pass a string:
$.tmpl("<div class="myClass">${FirstName},/div>", myObject).appendTo("#myDiv");

use a selector to find a script block on the page:
$("#myTemplate").tmpl(myObjects).appendTo("#myDiv");

...

<script id="myTemplate" type="text/x-jquery-tmpl">
    <tr>
        <td>${FirstName},/td>
        <td>${LastName},/td>
        <td>${Twitter},/td>
    </tr>
</script>

get an external "html" which contain the html template:

$.get("MyTemplate.htm", function (data) {
    $.tmpl(data, myObjects).appendTo("#myDiv");
});

jQuery General Performance Tips


  • use the latest jQuery
  • Caching Selections (assign it to a variable) 
  • Caching Other Items
  • Use element properties (DOM) when possible (instead of jQuery properties)


Monday, 4 February 2013

jQuery Type Testing Functions

  • Determine the type of an object
  • Useful for optional parameters & validation

Functions:
  • $.isArray(array)
  • $.isFunction(function) - another way to do this ( if (typeof <functionName> == "function")
  • $.isEmptyObject(object)
  • $.isPlainObject(object)
  • $.isXmlDoc(doc)
  • $.isNumeric(number)
  • $.isWindow(window)
  • $.type(object)

 Return Values:
  • boolean
  • number
  • string
  • function
  • array
  • date
  • regexp
  • object
  • undefined
  • null

Turn javascript object into a string

use json2.js from http://www.JSON.org/json2.js

e.g.
<script src="json2.js"></script>
...
JSON.stringify( {
    FirstName: $('#FirstName').val(),
    LastName: $('#LastName').val()
});

To turn a JSON string into javascript ojbect, use parseJSON.

var json = '{"fname" : "john", "lname" : "smith", "age" : 35}';
var jsObject = $.parseJSON(json);


Fiddler

Download the free web debug tool here:
https://fiddler2.com/fiddler2/version.asp

When working on the localhost, add the "." before the port, e.g.

http://localhost.:1064/

WCF returning Json data

in the .net world, we need to get the data by getting the property d like this:

var cust = data.d[0];

var cust = data.d.firstname;

this won't work: var cust = data[0];

Thursday, 31 January 2013

.Net Resource file - multiple designers.cs files

Open the .csproj file
find the "LastGenOutput" tag for each resource file and make sure it is <resource file name>.Designer.cs


MVC - Sending Email using Exchange Server

Add the following in the Web.config file:

<system.net>
  <mailSettings>

    <smtp from="info@mycompany.com">
<network enableSsl="false" port="25" host="mail.mycompany.com" defaultCredentials="true" />
    </smtp>


  </mailSettings>


</system.net>

Without setting "defaultCredentials" to true, you can only send email in the same domain.  When you send email outside the domain, you will receive "Mailbox unavailable. The server response was: 5.7.1 Unable to relay for whoever@notmycompany.com" error.

Monday, 28 January 2013

Tough person around you...

You can’t change a person, but you can change the way you see him/her.

You may not change the person, but it’ll change your attitude toward him/her.  Who knows? Maybe he/she’ll start to change when you start to see him/her differently!

Friday, 25 January 2013

Bible

Yes, any Bible verse can be misused, but that doesn’t make it useless!

MVC Validation - Integer types

All the fields with Integer types will be required by default unless we declare it as <Nullable>.

Thursday, 3 January 2013

C# HashSet

A HashSet holds a set of objects, in a way that it allows you to easily and quickly determine whether an object is already in the set or not.

C# HashSet class preserves the order of the elements.

The only catch of HashSet is that there is no access by indices.