Search Results

Search found 4 results on 1 pages for 'mathk'.

Page 1/1 | 1 

  • Digital audio does not work on MacBook Pro

    - by mathk
    I have a MacBook Pro (8,2). Using a TOSLINK cable I have no digital output. Oddly enough, sometime I can hear a glitch when I plug in the cable or when I give it a gentle wiggle. My guess is that the output is not correctly detecting that I have a digital link. So is there a way to force digital audio output on a MacBook Pro? Some say that in the Audio MIDI Setup there is an option but I can't find it. I am running OS X 10.7.5.

    Read the article

  • Passing an array for setting variable

    - by mathk
    Hi, I often see this idiom when reading php code: public function __construct($config) { if (array_key_exists('options', $config)) { ... } if (array_key_exists('driver_options', $config)) { ... } } Here I am concern with the way the parameter is used. If I were in lisp I would do: (defun ct (&key options driver_options) (do-something-with-option-and-driver_option)) But since I am in PHP I would rather have a constructor that take a list of parameter and let them be null if there a not require. So what do you guys think about having an array as parameter in other to do some initialization-or-whatever? In other to answer you have to take in account the point of view of the user of the function and the designer of the API. Also have you ever heard this has a code-smell? thanks

    Read the article

  • How to handle authorization in the view layout

    - by mathk
    Authorize attribute are good to do some access control base on Action but suppose that I have some UI element in the layout that should note be output unless the user is authorize. I could possibly set some boolean in the ViewBag but that is not the good solution I guess. Somewhere in the Layout.cshtml: @if (ViewBag.IsAuthorized) { <li>@Html.ActionLink("Index", "Admin")</li> } Let me know if there is a better solution. Thanks.

    Read the article

1