Tuesday, November 5, 2013

[Fixed] Intel wireless N 6230 on Ubuntu

I had issue with the Intel wireless card, and it kept on dropping connection when I am working online, thus I look for solution online.

Then I found this: http://ubuntuforums.org/showthread.php?t=2012228

To put it in short:
  1. Open terminal in Ubuntu
  2. Type:
    gksudo gedit /etc/pm/power.d/wireless
  3. Then enter these inside gedit: 
    #!/bin/sh
    /sbin/iwconfig wlan0 power off
    exit0
  4. Save and close gedit.
  5. Run the following commands:
    echo "options iwlwifi 11n_disable=1" | sudo tee /etc/modprobe.d/iwlwifi.conf
    sudo modprobe -rfv iwlwifi
    sudo modprobe -v iwlwifi
    sudo reboot
     
     If you still having issue with the wifi, 
    navigate to /etc/modprobe.d, 
    then sudo gedit iwlwifi.conf 
    Edit the line to:
    options iwlwifi 11n_disable=1 wd_disable=1 bt_coex_active=N  
     

Friday, November 1, 2013

Convert arguments into array in javascript

Let see this senario:

var func = function(){
      arguments.push('foo');
}

Then you run func('a', 'b', 'c'), you will get Object has no method 'push'.

To enable your arguments being treated as array,

var func = function(){
        var arry = Array.prototype.slice.call(arguments);
        arry.push('foo');
}

You would able to use the push method, because you have converted the arguments into array.