text:
Q: All buttons lose function after I use once I have a button that displays a custom dialogue box.  If the user selects 'cancel', the dialogue box should be removed from the DOM and no further action is taken.  If they click 'Start Delete', it should proceed with code.
The dialogue box shows and hides correctly, however, after I cancel and hide the dialogue box, the button no longer works to display the dialogue box again.
I have created a popup class that uses a template string to display the popup and I then inject it into the DOM.  The popup takes a callback in the constructor, which I use to hide the popup.
Please see the following JS Fiddle:
https://jsfiddle.net/khgriffi259/vs6r5ake/13/

  class Popup {

    constructor(title, message, callback) {
      this.title = title;
      this.message = message;
      this.callback = callback;
      this.container = document.querySelector('body');
      this.result = '';
    }

    init() {
      const popup = `

X

${this.title}

${this.message}

                          <button class="btn popup-no" >Cancel</button>
                          <button class="btn btn-danger my-1 popup-yes" >Start Delete</button>

      `;
      this.container.innerHTML += popup;

      this.container.querySelector('.popup-no').addEventListener('click', () => this.cancelListener());
      this.container.querySelector('.popup-yes').addEventListener('click', () => this.startListener());

    }

    cancelListener() {
      this.result = false;

        this.callback();
    //   if (this.callback !== undefined) {
    //     this.callback(this.result);
    //   }
    }

    startListener() {
      this.result  = true;
      if (this.callback !== undefined) {
        this.callback();
      }
    }

       getResult() {
         console.log(this.result) ;
        return this.result;
        }

  }

    //end of Popup Class

const button = document.querySelector('button');
button.addEventListener('click',  e => {
  if (e.target.tagName === 'BUTTON') {

    const confirmDelete = new Popup(
      'Delete',
      'This will permanently delete this experience record.',
      ()=>{
        console.log('hello');
        let elem = document.querySelector('.popup-wrapper');
        elem.parentNode.removeChild(elem);

      }
    );
    confirmDelete.init();
     }
})
<button>
click me
</button>

I expect the popup to hide and for the button to be functional to generate a new Popup if user clicks the button again.

A: See below for a fixed version of your code.
The only change is from
this.container.innerHTML += popup;

to
this.container.insertAdjacentHTML('beforeend', popup);

The reason your original code fails is that .innerHTML serializes the DOM tree back to an HTML string, appends popup, then the assignment to .innerHTML reparses the whole thing, recreating all elements from scratch. As a side effect, your original click listener is lost because it's still attached to the old button element. Assigning to .innerHTML means you get a completely new DOM tree.
As the documentation for insertAdjacentHTML states:

The insertAdjacentHTML() method of the Element interface parses the specified text as HTML or XML and inserts the resulting nodes into the DOM tree at a specified position. It does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element. This avoids the extra step of serialization, making it much faster than direct innerHTML manipulation.

(Emphasis mine.)

  class Popup {

    constructor(title, message, callback) {
      this.title = title;
      this.message = message;
      this.callback = callback;
      this.container = document.querySelector('body');
      this.result = '';
    }

    init() {
      const popup = `

X

${this.title}

${this.message}

                          <button class="btn popup-no" >Cancel</button>
                          <button class="btn btn-danger my-1 popup-yes" >Start Delete</button>

      `;
      this.container.insertAdjacentHTML('beforeend', popup);

      this.container.querySelector('.popup-no').addEventListener('click', () => this.cancelListener());
      this.container.querySelector('.popup-yes').addEventListener('click', () => this.startListener());

    }

    cancelListener() {
      this.result = false;

        this.callback();
    //   if (this.callback !== undefined) {
    //     this.callback(this.result);
    //   }
    }

    startListener() {
      this.result  = true;
      if (this.callback !== undefined) {
        this.callback();
      }
    }

       getResult() {
         console.log(this.result) ;
        return this.result;
        }

  }

    //end of Popup Class

const button = document.querySelector('button');
button.addEventListener('click',  e => {
  if (e.target.tagName === 'BUTTON') {

    const confirmDelete = new Popup(
      'Delete',
      'This will permanently delete this experience record.',
      ()=>{
        console.log('hello');
        let elem = document.querySelector('.popup-wrapper');
        elem.parentNode.removeChild(elem);

      }
    );
    confirmDelete.init();
     }
})
<button>
click me
</button>

A: When you edit the innerHTML of the body you clear the eventListener on the button.
I've updated the fiddle to a working version here https://jsfiddle.net/n5k9rsbe/6/
There are 2 ways to get this working:
1 - Create a container element and modify that

JavaScript:
document.querySelector('#container').innerHTML = '...';

2 - Use appendChild on the body
const elem = document.createElement('div');
elem.innerHTML = popup
this.container.appendChild(elem)


text:
Q: Custom PagerAdapter, override setPrimaryItem method calling continuously I am using custom PagerAdapter in my application, in that override the method setPrimaryItem. When I view the html using webview through PagerAdapter, the setPrimaryItem method is keep on calling continuously. Because of that html is flickering in the screen. Anybody knows why it's behaving like this?
The setPrimaryMethod() code below:
@Override
    public void setPrimaryItem(ViewGroup container, int position, Object object)
    {
        super.setPrimaryItem(container, position, object);

        ScrollView scrollView = (ScrollView) object;
        ViewGroup llViewGrp = (LinearLayout)scrollView.getChildAt(0);
        View view = llViewGrp.getChildAt(0);

        if (view instanceof StudentElementHtmlView) {
            List<StudentElementEntity> studentElementsEntity = entity.get(position).getElements();

            //iterate through all elements and set the element to save the answer
            for (StudentElementEntity element : studentElementsEntity) {
                //check for the html element entity
                if (element instanceof StudentElementHtmlEntity) {
                    ((StudentElementHtmlView) view).setElement((StudentElementHtmlEntity) element);
                }
            }
        }
    }

Thanks
Krish

A: I thought the reason may be that the gesture detector had been collision between ViewPager and WebView. You should override the onInterceptTouch() and onTouch() methods in child view,and invoke the requestDisallowInterceptTouchEvent(boolean flag) method in the child or the parent depend on your need。

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to let a Visual Studio 2015 xproject (project.json) reference the highest framework of a depending project I'm creating a reusable library that targets several platforms (.NET 4.0, .NET 4.5, .NETStandard 1.0 and .NETStandard 1.3). The .NET 4.5 version of this project contains some features that are not available under the .NET 4.0 version.
The unit test project that references this library project has one single target platform, namely NET 4.5.1. This test project obviously contains some code that tests the .NET 4.5 specific features of the core library.
Unfortunately however, the test project does not compile, because Visual Studio seems to reference the .NETStandard 1.0 version, which obviously does not contain this feature.
To demonstrate my problem, I reduced this to the following two projects:
Core library:
{
  "version": "1.0.0-*",

  "frameworks": {
    "netstandard1.0": {
      "dependencies": {
        "NETStandard.Library": "1.6.0"
      }
    },
    "net40": {},
    "net45": {}
  }
}

Code file:
namespace CoreLibrary
{
#if NETSTANDARD1_0
    public class ClassNetStandard { }
#endif

#if NET40
    public class ClassNet40 { }
#endif

#if NET45
    public class ClassNet45 { }
#endif
}

Test library:
{
  "version": "1.0.0-*",

  "dependencies": {
    "CoreLibrary": { "target": "project" }
  },
  "frameworks": {
    "net451": {}
  }
}

Code:
// This compiles
new CoreLibrary.ClassNetStandard();

// This doesn't.
// error: Type or namespace 'ClassNet40' does not exist in namespace 'CoreLibrary'
new CoreLibrary.ClassNet40();
// error: Type or namespace 'ClassNet45' does not exist in namespace 'CoreLibrary'
new CoreLibrary.ClassNet45();

What should I change to allow my unit test project to compile and test the specific .NET 4.5 features?

A: There seems to be a bug in Visual Studio tools for .NET Core. When you reference multi-framework project from another one - Visual Studio only takes first listed framework from a list (in your case - "netstandard1.0") and treats that referenced project as single targeted for this framework. However, compiler handles this correctly, and while it seems that project builds correctly - in reality it does not. On the other hand, when you use ClassNet45 definition - it seems that it does not compile (Visual Studio shows errors) - it really does compile successfully.
It seems that Visual Studio tools for .NET Core are not polished enough yet, but probably this bug will be resolved in some near future.


text:
Q: How does Denver/Carmel handle optimization cache overflow Prologue
I am not sure whether I should ask this question on Stackoverflow or Super User or even another stack exchange site, so please direct me if there is a more suitable place.
Main Body
I read the IEEE paper by Nvidia introducing Denver and found that about optimization cache management, only the part quoted below is relevant.

Optimization cache management uses a mark-and-sweep algorithm to manage the available optimization execution memory.

However, I would like to know if the optimization cache is full, but the dynamic code optimizer (DCO) decides to optimize some more ARM instructions into native micro-ops, what will happen?
I can think of three possible implementations, but I am not sure which one is true.

*

*Keep using the hardware decoder to deal with newly-encountered ARM instructions until the optimization cache has enough space.

*Record some statistics to decide whether a optimized block of code needs to be replaced.

*Simply flush the optimization cache.

Google yields no results, and I appreciate any references I may have overlooked.


text:
Q: Patterns: Populate instance from Parameters and export it to XML I'm building a simple RESTFul Service; and for achieve that I need two tasks:

*

*Get an instance of my resource (i.e Book) from request parameters, so I can get that instance to be persisted

*Build an XML document from that instance to send the representation to the clients

Right now, I'm doing both things in my POJO class:
public class Book implements Serializable {

    private Long id;

    public Book(Form form) {
        //Initializing attributes
        id = Long.parseLong(form.getFirstValue(Book.CODE_ELEMENT));
    }

    public Element toXml(Document document) {
        // Getting an XML Representation of the Book
        Element bookElement = document.createElement(BOOK_ELEMENT);
    }

I've remembered an OO principle that said that behavior should be where the data is, but now my POJO depends from Request and XML API's and that doesn't feels right (also, that class has persistence anotations)
Is there any standard approach/pattern to solve that issue?
EDIT:
The libraries i'm using are Restlets and Objectify.

A: I agree with you when you say that the behavior should be where the data is. But at the same time, as you say I just don't feel confortable polluting a POJO interface with specific methods used for serialization means (which can grow considerably depending on the way you want to do it - JSON, XML, etc.).

1) Build an XML document from that instance to send the representation to the clients

In order to decouple the object from serialization logic, I would adopt the Strategy Pattern:
interface BookSerializerStrategy {
    String serialize(Book book);
}

public class XmlBookSerializerStrategy implements BookSerializerStrategy {

    public String serialize(Book book) {
        // Do something to serialize your book.
    }

}

public class JsonBookSerializerStrategy implements BookSerializerStrategy {

    public String serialize(Book book) {
        // Do something to serialize your book.
    }

}

You POJO interface would become:
public class Book implements Serializable {

    private Long id;
    private BookSerializerStrategy serializer

    public String serialize() {
        return serializer.serialize(this);
    }

    public void setSerializer(BookSerializerStrategy serializer) {
        this.serializer = serializer;
    }
}

Using this approach you will be able to isolate the serialization logic in just one place and wouldn't pollute your POJO with that. Additionally, returning a String I won't need to couple you POJO with classes Document and Element.

2) Get an instance of my resource (i.e Book) from request parameters, so I can get that instance to be persisted

To find a pattern to handle the deserialization is more complex in my opinion. I really don't see a better way than to create a Factory with static methods in order to remove this logic from your POJO.
Another approach to answer your two questions would be something like JAXB uses: two different objects, an Unmarshaller in charge of deserialization and a Marshaller for serialization. Since Java 1.6, JAXB comes by default with JDK.
Finally, those are just suggestions. I've become really interested in your question actually and curious about other possible solutions.

A: Are you using Spring, or any other framework, in your project? If you used Spring, it would take care of serialization for you, as well as assigning request params to method params (parsing as needed).


text:
Q: CodingBat Warmup-1 near_hundred Python The prompt is:
Given an int n, return True if it is within 10 of 100 or 200. Note: abs(num) computes the absolute value of a number.
ex.
near_hundred(93) → True
near_hundred(90) → True
near_hundred(89) → False
I wanted code that could return a 'near hundred' value for any number so I used this technique:
def near_hundred(n):
  r = n % 100
  r = abs(r)

  return( r >= 90 or r <= 10)

The issue is for test values '0', '5', or '290' my program returns a false negative. What am I not understanding that causes this?

A: return (abs(100-n) <= 10) or (abs(200-n) <= 10)

A: My Solution - Probably Not the most Efficient but is Readable
def near_hundred(n):
  if 90 <= n <= 110:
    return True
  elif 190 <= n <= 210:
    return True
  else:
    return False

A: def near_hundred(n):
  if n in range (90, 111):
    return True
  elif n in range (190, 211):
    return True
  else:
    return False

It tests for n in the range 90 - 111 and 190 to 211 (Note range does not account for the last number, so 111 and 211 are not included).

A: def near_hundred(n):
  if n < 90 or (n > 110 and n<190):
    return False
  elif n>210:
    return False
  elif abs(100-n) >= 90 or 110<=(100+n) :
    return True
  return False

A: My solution:
def nearHundred(n):
    if 90 <= n <= 110 or 190 <= n <= 210:
        return True
    else:
        return False
    pass

A: if (n>=90 and n<=110 or n>=190 and n<=210):
    return True
else:
    return False


text:
Q: Rerun (reschedule) onetime pipeline I've created a new onetime pipeline in Azure Data Factory using Copy Data wizard.
The pipeline has 4 activities and it was run just fine - all 4 activities succeeded.
Now I'd like to rerun the pipeline. So I do:

*

*Clone the pipeline.

*Change name to [name]_rev2.

*Remove start and end properties.

*Deploy the cloned pipeline.

Now the status of the new cloned pipeline is Running.
But no activities are executed at all.
What's wrong?

A: Mmmmm. Where to start!
In short. You can't just clone the pipeline. If its a one time data factory that you've created it won't have a schedule attached and therefore won't have any time slices provisioned that now require execution.
If your unsure how time slices in ADF work a recommend some reading around this concept.
Next, I recommend opening up a Visual Studio 2015 solution and downloading the data factory that did run as a project. Check out the various JSON blocks for scheduling and interval availability in the datasets, activities and the time frame in the pipeline.
Here's a handy guide for scheduling and execution to understand how to control your pipelines.
https://learn.microsoft.com/en-us/azure/data-factory/data-factory-scheduling-and-execution
Once you've made all the required changes (not just the name) publish the project to a new ADF service.
Hope this helps


text:
Q: How do I change the startup sound?
Possible Duplicate:
How do I change the start up sound?

Note: This is not a duplicate. The above question refers to the sound played at login and not the sound at the login screen.
Is there some way to change the sound that is played when the login screen is displayed? Currently it's a short drum beat.
Note that I am not referring to the login sound, which in Ubuntu 12.04 is no longer enabled by default, but the much shorter sound at the login screen.


text:
Q: CoreOS Fleet Vs. Ansible Maybe this is a stupid question, but I've been working with Ansible, and I just came across CoreOS Fleet.  I could be wrong, but Fleet seems to do almost the exact same in terms of just being another tool to provision/run commands on multiple servers, and is native to CoreOS.  CoreOS has it's cloud-config user-data file and Ansible has playbooks.  Ansible is obviously different in that it is a tool to execute over SSH, but there seems to be a lot of overlap.  I'm new to both of them and feel there must be something big I am missing that Fleet offers over Ansible.  Do they have a different purpose, and if so what is the big difference?

A: CoreOS is a Linux distribution specializing in running containers, fleet and etcd provide cluster services on top of that. Ansible deploys a defined state to remote hosts, mostly Linux but also a little Unix and Windows.
Ansible doesn't provide services itself or require an agent on the host. etcd provides shared state and fleet an init system, with multiple nodes.
They can complement each other if you deploy and maintain CoreOS nodes with Ansible. Or they can compete if you deploy with Ansible at the (virtual) machine level and not containers. Or use something else entirely, there are many ways to deploy things.


text: Q: Microsoft Access Form entering data. (Skill Matrix) I am very new to Microsoft access. I am trying to create a form that allows a team member to enter their Fn, Ln, and the team they are on. Then, go through each "Skill" and then fill in their competency on that particular skill. I am having trouble with the skill part because there are a lot of skills under one "Skill Category" (See my images). After this, they just press submit and the data goes to my "Skill Matrix" table. I would just like feedback, maybe my table designs are bad. Thank you.


text:
Q: Wireless card power management I have noticed that when my computer in plugged in, the wireless strength increases. I'm assuming this is to do with power management.
Is there a way to disable Wireless Power Management?
I have found a few blog posts that show hacks to disable this but what is best practice here? Should there not be an option via the power menu that lets you toggle this?
EDIT -- FILES AND LOGS AS REQUESTED
/var/log/kern.log
Jul 11 11:45:27 CoolBreeze kernel: [    6.528052] postgres (1308): /proc/1308/oom_adj is deprecated, please use /proc/1308/oom_score_adj instead.
Jul 11 11:45:27 CoolBreeze kernel: [    6.532080] [fglrx] Gart USWC size:1280 M.
Jul 11 11:45:27 CoolBreeze kernel: [    6.532084] [fglrx] Gart cacheable size:508 M.
Jul 11 11:45:27 CoolBreeze kernel: [    6.532091] [fglrx] Reserved FB block: Shared offset:0, size:1000000
Jul 11 11:45:27 CoolBreeze kernel: [    6.532094] [fglrx] Reserved FB block: Unshared offset:f8fd000, size:403000
Jul 11 11:45:27 CoolBreeze kernel: [    6.532098] [fglrx] Reserved FB block: Unshared offset:3fff4000, size:c000
Jul 11 11:45:38 CoolBreeze kernel: [   17.423743] eth1: no IPv6 routers present
Jul 11 11:46:37 CoolBreeze kernel: [   75.836426] warning: `proftpd' uses 32-bit capabilities (legacy support in use)
Jul 11 11:46:37 CoolBreeze kernel: [   75.884215] init: plymouth-stop pre-start process (2922) terminated with status 1
Jul 11 11:54:25 CoolBreeze kernel: [  543.679614] eth1: no IPv6 routers present

dmesg
[    1.411959] ACPI: Power Button [PWRB]
[    1.412046] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input1
[    1.412054] ACPI: Sleep Button [SLPB]
[    1.412150] input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input2
[    1.412765] ACPI: Lid Switch [LID0]
[    1.412866] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    1.412874] ACPI: Power Button [PWRF]
[    1.412996] ACPI: Fan [FAN0] (off)
[    1.413068] ACPI: Fan [FAN1] (off)
[    1.419493] thermal LNXTHERM:00: registered as thermal_zone0
[    1.419498] ACPI: Thermal Zone [TZ00] (27 C)
[    1.421913] thermal LNXTHERM:01: registered as thermal_zone1
[    1.421918] ACPI: Thermal Zone [TZ01] (61 C)
[    1.421971] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
[    1.421986] ACPI: Battery Slot [BAT0] (battery present)
[    1.422062] ERST: Table is not found!
[    1.422067] GHES: HEST is not enabled!
[    1.422158] isapnp: Scanning for PnP cards...
[    1.422242] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    1.434620] ACPI: Battery Slot [BAT0] (battery present)
[    1.736355] Freeing initrd memory: 14352k freed
[    1.777846] isapnp: No Plug & Play device found
[    1.963650] Linux agpgart interface v0.103
[    1.967148] brd: module loaded
[    1.968866] loop: module loaded
[    1.969134] ahci 0000:00:1f.2: version 3.0
[    1.969154] ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[    1.969226] ahci 0000:00:1f.2: irq 45 for MSI/MSI-X
[    1.969277] ahci: SSS flag set, parallel bus scan disabled
[    1.969320] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 3 Gbps 0x23 impl SATA mode
[    1.969329] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pio slum part ems sxs apst
[    1.969338] ahci 0000:00:1f.2: setting latency timer to 64
[    1.983340] scsi0 : ahci
[    1.983515] scsi1 : ahci
[    1.983670] scsi2 : ahci
[    1.983829] scsi3 : ahci
[    1.983985] scsi4 : ahci
[    1.984145] scsi5 : ahci
[    1.984270] ata1: SATA max UDMA/133 abar m2048@0xf1005000 port 0xf1005100 irq 45
[    1.984277] ata2: SATA max UDMA/133 abar m2048@0xf1005000 port 0xf1005180 irq 45
[    1.984282] ata3: DUMMY
[    1.984285] ata4: DUMMY
[    1.984288] ata5: DUMMY
[    1.984292] ata6: SATA max UDMA/133 abar m2048@0xf1005000 port 0xf1005380 irq 45
[    1.985150] Fixed MDIO Bus: probed
[    1.985192] tun: Universal TUN/TAP device driver, 1.6
[    1.985196] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    1.985285] PPP generic driver version 2.4.2
[    1.985472] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.985507] ehci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    1.985534] ehci_hcd 0000:00:1a.0: setting latency timer to 64
[    1.985541] ehci_hcd 0000:00:1a.0: EHCI Host Controller
[    1.985626] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
[    1.985666] ehci_hcd 0000:00:1a.0: debug port 2
[    1.989663] ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported
[    1.989690] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xf1005800
[    2.002183] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
[    2.002447] hub 1-0:1.0: USB hub found
[    2.002455] hub 1-0:1.0: 3 ports detected
[    2.002607] ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[    2.002633] ehci_hcd 0000:00:1d.0: setting latency timer to 64
[    2.002639] ehci_hcd 0000:00:1d.0: EHCI Host Controller
[    2.002737] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
[    2.002775] ehci_hcd 0000:00:1d.0: debug port 2
[    2.006780] ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported
[    2.006806] ehci_hcd 0000:00:1d.0: irq 23, io mem 0xf1005c00
[    2.022161] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
[    2.022401] hub 2-0:1.0: USB hub found
[    2.022409] hub 2-0:1.0: 3 ports detected
[    2.022567] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.022599] uhci_hcd: USB Universal Host Controller Interface driver
[    2.022720] usbcore: registered new interface driver libusual
[    2.022813] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    2.035831] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.035844] serio: i8042 AUX port at 0x60,0x64 irq 12
[    2.036096] mousedev: PS/2 mouse device common for all mice
[    2.036710] rtc_cmos 00:07: RTC can wake from S4
[    2.036881] rtc_cmos 00:07: rtc core: registered rtc_cmos as rtc0
[    2.037143] rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[    2.037503] device-mapper: uevent: version 1.0.3
[    2.037656] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
[    2.037725] EISA: Probing bus 0 at eisa.0
[    2.037729] EISA: Cannot allocate resource for mainboard
[    2.037734] Cannot allocate resource for EISA slot 1
[    2.037738] Cannot allocate resource for EISA slot 2
[    2.037741] Cannot allocate resource for EISA slot 3
[    2.037745] Cannot allocate resource for EISA slot 4
[    2.037749] Cannot allocate resource for EISA slot 5
[    2.037753] Cannot allocate resource for EISA slot 6
[    2.037756] Cannot allocate resource for EISA slot 7
[    2.037760] Cannot allocate resource for EISA slot 8
[    2.037764] EISA: Detected 0 cards.
[    2.037782] cpufreq-nforce2: No nForce2 chipset.
[    2.038264] cpuidle: using governor ladder
[    2.039015] cpuidle: using governor menu
[    2.039019] EFI Variables Facility v0.08 2004-May-17
[    2.040061] TCP cubic registered
[    2.041438] NET: Registered protocol family 10
[    2.043814] NET: Registered protocol family 17
[    2.043823] Registering the dns_resolver key type
[    2.044290] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    2.044336] Using IPI No-Shortcut mode
[    2.045620] PM: Hibernation image not present or could not be loaded.
[    2.045644] registered taskstats version 1
[    2.073070]   Magic number: 4:976:796
[    2.073415] rtc_cmos 00:07: setting system clock to 2012-07-11 18:45:23 UTC (1342032323)
[    2.076654] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    2.076658] EDD information not available.
[    2.302111] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    2.302587] ata1.00: ATA-9: M4-CT128M4SSD2, 000F, max UDMA/100
[    2.302595] ata1.00: 250069680 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    2.303143] ata1.00: configured for UDMA/100
[    2.303453] scsi 0:0:0:0: Direct-Access     ATA      M4-CT128M4SSD2   000F PQ: 0 ANSI: 5
[    2.303746] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    2.303920] sd 0:0:0:0: [sda] 250069680 512-byte logical blocks: (128 GB/119 GiB)
[    2.304213] sd 0:0:0:0: [sda] Write Protect is off
[    2.304225] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.304471] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.306818]  sda: sda1 sda2 < sda5 >
[    2.308780] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.318162] Refined TSC clocksource calibration: 1595.999 MHz.
[    2.318169] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[    2.318178] Switching to clocksource tsc
[    2.450939] hub 1-1:1.0: USB hub found
[    2.451121] hub 1-1:1.0: 6 ports detected
[    2.561786] usb 2-1: new high-speed USB device number 2 using ehci_hcd
[    2.621757] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    2.636143] ata2.00: ATAPI: TSSTcorp DVD+/-RW TS-T633C, D800, max UDMA/100
[    2.636152] ata2.00: applying bridge limits
[    2.649711] ata2.00: configured for UDMA/100
[    2.653762] scsi 1:0:0:0: CD-ROM            TSSTcorp DVD+-RW TS-T633C D800 PQ: 0 ANSI: 5
[    2.661486] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    2.661494] cdrom: Uniform CD-ROM driver Revision: 3.20
[    2.661890] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    2.662156] sr 1:0:0:0: Attached scsi generic sg1 type 5
[    2.694649] hub 2-1:1.0: USB hub found
[    2.694840] hub 2-1:1.0: 8 ports detected
[    2.765823] usb 1-1.4: new high-speed USB device number 3 using ehci_hcd
[    2.981454] ata6: SATA link down (SStatus 0 SControl 300)
[    2.982597] Freeing unused kernel memory: 740k freed
[    2.983523] Write protecting the kernel text: 5816k
[    2.983808] Write protecting the kernel read-only data: 2376k
[    2.983811] NX-protecting the kernel data: 4424k
[    3.014594] udevd[127]: starting version 175
[    3.068925] sdhci: Secure Digital Host Controller Interface driver
[    3.068932] sdhci: Copyright(c) Pierre Ossman
[    3.069714] sdhci-pci 0000:09:00.0: SDHCI controller found [1180:e822] (rev 1)
[    3.069742] sdhci-pci 0000:09:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    3.069786] sdhci-pci 0000:09:00.0: Will use DMA mode even though HW doesn't fully claim to support it.
[    3.069798] sdhci-pci 0000:09:00.0: setting latency timer to 64
[    3.069816] mmc0: no vmmc regulator found
[    3.069877] Registered led device: mmc0::
[    3.070946] mmc0: SDHCI controller on PCI [0000:09:00.0] using DMA
[    3.071078] tg3.c:v3.121 (November 2, 2011)
[    3.071252] tg3 0000:0b:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    3.071269] tg3 0000:0b:00.0: setting latency timer to 64
[    3.071403] firewire_ohci 0000:09:00.3: PCI INT D -> GSI 19 (level, low) -> IRQ 19
[    3.071417] firewire_ohci 0000:09:00.3: setting latency timer to 64
[    3.078509] EXT4-fs (sda1): INFO: recovery required on readonly filesystem
[    3.078517] EXT4-fs (sda1): write access will be enabled during recovery
[    3.110417] tg3 0000:0b:00.0: eth0: Tigon3 [partno(BCM95784M) rev 5784100] (PCI Express) MAC address b8:ac:6f:71:02:a6
[    3.110425] tg3 0000:0b:00.0: eth0: attached PHY is 5784 (10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[0])
[    3.110431] tg3 0000:0b:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
[    3.110436] tg3 0000:0b:00.0: eth0: dma_rwctrl[76180000] dma_mask[64-bit]
[    3.125492] firewire_ohci: Added fw-ohci device 0000:09:00.3, OHCI v1.10, 4 IR + 4 IT contexts, quirks 0x11
[    3.390124] EXT4-fs (sda1): orphan cleanup on readonly fs
[    3.390135] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078710
[    3.390232] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 2363071
[    3.390327] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078711
[    3.390350] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078709
[    3.390367] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078708
[    3.390384] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078707
[    3.390401] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078706
[    3.390417] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078705
[    3.390435] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078551
[    3.390452] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078523
[    3.390470] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7078520
[    3.390487] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 7077901
[    3.390551] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 4063272
[    3.390562] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 4063266
[    3.390572] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 4063261
[    3.390582] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 4063256
[    3.390592] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 4063255
[    3.390602] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 2363072
[    3.390620] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 2360050
[    3.390698] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 5250064
[    3.390710] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 2365394
[    3.390728] EXT4-fs (sda1): ext4_orphan_cleanup: deleting unreferenced inode 2365390
[    3.390745] EXT4-fs (sda1): 22 orphan inodes deleted
[    3.390748] EXT4-fs (sda1): recovery complete
[    3.397636] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[    3.624910] firewire_core: created device fw0: GUID 464fc000110e2661, S400
[    3.927467] ADDRCONF(NETDEV_UP): eth0: link is not ready
[    3.929965] udevd[400]: starting version 175
[    3.933581] Adding 6278140k swap on /dev/sda5.  Priority:-1 extents:1 across:6278140k SS
[    3.945183] lp: driver loaded but no devices found
[    3.999389] wmi: Mapper loaded
[    4.016696] ite_cir: Auto-detected model: ITE8708 CIR transceiver
[    4.016702] ite_cir: Using model: ITE8708 CIR transceiver
[    4.016706] ite_cir: TX-capable: 1
[    4.016710] ite_cir: Sample period (ns): 8680
[    4.016713] ite_cir: TX carrier frequency (Hz): 38000
[    4.016716] ite_cir: TX duty cycle (%): 33
[    4.016719] ite_cir: RX low carrier frequency (Hz): 0
[    4.016722] ite_cir: RX high carrier frequency (Hz): 0
[    4.025684] fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.
[    4.025691] Disabling lock debugging due to kernel taint
[    4.027410] IR NEC protocol handler initialized
[    4.030250] lib80211: common routines for IEEE802.11 drivers
[    4.030257] lib80211_crypt: registered algorithm 'NULL'
[    4.036024] IR RC5(x) protocol handler initialized
[    4.036092] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[    4.036188] snd_hda_intel 0000:00:1b.0: irq 46 for MSI/MSI-X
[    4.036307] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[    4.036361] [Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
[    4.039006] acpi device:03: registered as cooling_device10
[    4.039164] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/LNXVIDEO:00/input/input5
[    4.039261] ACPI: Video Device [M86] (multi-head: yes  rom: no  post: no)
[    4.049753] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[    4.050201] wl 0000:05:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[    4.050215] wl 0000:05:00.0: setting latency timer to 64
[    4.052252] Registered IR keymap rc-rc6-mce
[    4.052432] input: ITE8708 CIR transceiver as /devices/virtual/rc/rc0/input6
[    4.054614] IR RC6 protocol handler initialized
[    4.054787] rc0: ITE8708 CIR transceiver as /devices/virtual/rc/rc0
[    4.054839] ite_cir: driver has been successfully loaded
[    4.057338] IR JVC protocol handler initialized
[    4.061553] IR Sony protocol handler initialized
[    4.066578] input: MCE IR Keyboard/Mouse (ite-cir) as /devices/virtual/input/input7
[    4.066724] IR MCE Keyboard/mouse protocol handler initialized
[    4.072580] lirc_dev: IR Remote Control driver registered, major 250
[    4.073280] rc rc0: lirc_dev: driver ir-lirc-codec (ite-cir) registered at minor = 0
[    4.073286] IR LIRC bridge handler initialized
[    4.077849] Linux video capture interface: v2.00
[    4.079402] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Webcam_2M (0c45:640f)
[    4.085492] EDAC MC: Ver: 2.1.0
[    4.087138] lib80211_crypt: registered algorithm 'TKIP'
[    4.091027] input: HDA Intel Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[    4.091733] snd_hda_intel 0000:02:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    4.091826] snd_hda_intel 0000:02:00.1: irq 47 for MSI/MSI-X
[    4.091861] snd_hda_intel 0000:02:00.1: setting latency timer to 64
[    4.093115] EDAC i7core: Device not found: dev 00.0 PCI ID 8086:2c50
[    4.112448] HDMI status: Codec=0 Pin=3 Presence_Detect=0 ELD_Valid=0
[    4.112612] input: HD-Audio Generic HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input9
[    4.113311] type=1400 audit(1342032325.540:2): apparmor="STATUS" operation="profile_load" name="/sbin/dhclient" pid=658 comm="apparmor_parser"
[    4.114501] type=1400 audit(1342032325.540:3): apparmor="STATUS" operation="profile_load" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=658 comm="apparmor_parser"
[    4.115253] type=1400 audit(1342032325.540:4): apparmor="STATUS" operation="profile_load" name="/usr/lib/connman/scripts/dhclient-script" pid=658 comm="apparmor_parser"
[    4.121870] input: Laptop_Integrated_Webcam_2M as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/input/input10
[    4.122096] usbcore: registered new interface driver uvcvideo
[    4.122100] USB Video Class driver (1.1.1)
[    4.128729] [fglrx] Maximum main memory to use for locked dma buffers: 5840 MBytes.
[    4.129678] [fglrx]   vendor: 1002 device: 68c0 count: 1
[    4.131991] [fglrx] ioport: bar 4, base 0x2000, size: 0x100
[    4.132015] pci 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    4.132024] pci 0000:02:00.0: setting latency timer to 64
[    4.133712] [fglrx] Kernel PAT support is enabled
[    4.133747] [fglrx] module loaded - fglrx 8.96.4 [Mar 12 2012] with 1 minors
[    4.162666] eth1: Broadcom BCM4727 802.11 Hybrid Wireless Controller 5.100.82.38
[    4.184133] device-mapper: multipath: version 1.3.0 loaded
[    4.196660] dcdbas dcdbas: Dell Systems Management Base Driver (version 5.6.0-3.2)
[    4.279897] input: Dell WMI hotkeys as /devices/virtual/input/input11
[    4.292402] Bluetooth: Core ver 2.16
[    4.292449] NET: Registered protocol family 31
[    4.292454] Bluetooth: HCI device and connection manager initialized
[    4.292459] Bluetooth: HCI socket layer initialized
[    4.292463] Bluetooth: L2CAP socket layer initialized
[    4.292473] Bluetooth: SCO socket layer initialized
[    4.296333] Bluetooth: RFCOMM TTY layer initialized
[    4.296342] Bluetooth: RFCOMM socket layer initialized
[    4.296345] Bluetooth: RFCOMM ver 1.11
[    4.313586] ppdev: user-space parallel port driver
[    4.316619] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.316625] Bluetooth: BNEP filters: protocol multicast
[    4.383980] type=1400 audit(1342032325.812:5): apparmor="STATUS" operation="profile_load" name="/usr/lib/cups/backend/cups-pdf" pid=938 comm="apparmor_parser"
[    4.385173] type=1400 audit(1342032325.812:6): apparmor="STATUS" operation="profile_load" name="/usr/sbin/cupsd" pid=938 comm="apparmor_parser"
[    4.425757] init: failsafe main process (898) killed by TERM signal
[    4.477052] type=1400 audit(1342032325.904:7): apparmor="STATUS" operation="profile_replace" name="/sbin/dhclient" pid=1011 comm="apparmor_parser"
[    4.477592] type=1400 audit(1342032325.904:8): apparmor="STATUS" operation="profile_load" name="/usr/lib/lightdm/lightdm/lightdm-guest-session-wrapper" pid=1010 comm="apparmor_parser"
[    4.478099] type=1400 audit(1342032325.904:9): apparmor="STATUS" operation="profile_load" name="/usr/sbin/tcpdump" pid=1017 comm="apparmor_parser"
[    4.479233] type=1400 audit(1342032325.904:10): apparmor="STATUS" operation="profile_load" name="/usr/lib/telepathy/mission-control-5" pid=1014 comm="apparmor_parser"
[    4.510060] vesafb: mode is 1152x864x32, linelength=4608, pages=0
[    4.510065] vesafb: scrolling: redraw
[    4.510071] vesafb: Truecolor: size=0:8:8:8, shift=0:16:8:0
[    4.510084] mtrr: no more MTRRs available
[    4.513081] vesafb: framebuffer at 0xd0000000, mapped to 0xf9400000, using 3904k, total 3904k
[    4.515203] Console: switching to colour frame buffer device 144x54
[    4.515278] fb0: VESA VGA frame buffer device
[    4.590743] tg3 0000:0b:00.0: irq 48 for MSI/MSI-X
[    4.702009] ADDRCONF(NETDEV_UP): eth0: link is not ready
[    4.704409] ADDRCONF(NETDEV_UP): eth0: link is not ready
[    4.978379] psmouse serio1: synaptics: Touchpad model: 1, fw: 7.2, id: 0x1c0b1, caps: 0xd04733/0xa40000/0xa0000
[    5.030104] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input12
[    5.045782] kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL does not work properly. Using workaround
[    5.519573] [fglrx] ATIF platform detected with notification ID: 0x81
[    6.391466] fglrx_pci 0000:02:00.0: irq 49 for MSI/MSI-X
[    6.393137] [fglrx] Firegl kernel thread PID: 1305
[    6.393306] [fglrx] Firegl kernel thread PID: 1306
[    6.393472] [fglrx] Firegl kernel thread PID: 1307
[    6.393726] [fglrx] IRQ 49 Enabled
[    6.528052] postgres (1308): /proc/1308/oom_adj is deprecated, please use /proc/1308/oom_score_adj instead.
[    6.532080] [fglrx] Gart USWC size:1280 M.
[    6.532084] [fglrx] Gart cacheable size:508 M.
[    6.532091] [fglrx] Reserved FB block: Shared offset:0, size:1000000
[    6.532094] [fglrx] Reserved FB block: Unshared offset:f8fd000, size:403000
[    6.532098] [fglrx] Reserved FB block: Unshared offset:3fff4000, size:c000
[   17.423743] eth1: no IPv6 routers present
[   75.836426] warning: `proftpd' uses 32-bit capabilities (legacy support in use)
[   75.884215] init: plymouth-stop pre-start process (2922) terminated with status 1
[  543.679614] eth1: no IPv6 routers present

lsmod
Module                  Size  Used by
kvm_intel             127560  0
kvm                   359456  1 kvm_intel
joydev                 17393  0
vesafb                 13516  1
parport_pc             32114  0
bnep                   17830  2
ppdev                  12849  0
rfcomm                 38139  0
bluetooth             158438  10 bnep,rfcomm
dell_wmi               12601  0
sparse_keymap          13658  1 dell_wmi
binfmt_misc            17292  1
dell_laptop            17767  0
dcdbas                 14098  1 dell_laptop
dm_multipath           22710  0
fglrx                2909855  143
snd_hda_codec_hdmi     31775  1
psmouse                72919  0
serio_raw              13027  0
i7core_edac            23382  0
lib80211_crypt_tkip    17275  0
edac_core              46858  1 i7core_edac
uvcvideo               67203  0
snd_hda_codec_idt      60251  1
videodev               86588  1 uvcvideo
ir_lirc_codec          12739  0
lirc_dev               18700  1 ir_lirc_codec
ir_mce_kbd_decoder     12681  0
snd_seq_midi           13132  0
ir_sony_decoder        12462  0
ir_jvc_decoder         12459  0
snd_rawmidi            25424  1 snd_seq_midi
ir_rc6_decoder         12459  0
wl                   2646601  0
snd_seq_midi_event     14475  1 snd_seq_midi
snd_seq                51567  2 snd_seq_midi,snd_seq_midi_event
ir_rc5_decoder         12459  0
video                  19068  0
snd_hda_intel          32765  5
snd_seq_device         14172  3 snd_seq_midi,snd_rawmidi,snd_seq
snd_hda_codec         109562  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel
rc_rc6_mce             12454  0
lib80211               14040  2 lib80211_crypt_tkip,wl
snd_hwdep              13276  1 snd_hda_codec
ir_nec_decoder         12459  0
snd_pcm                80845  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
ite_cir                24743  0
rc_core                21263  10 ir_lirc_codec,ir_mce_kbd_decoder,ir_sony_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_rc5_decoder,rc_rc6_mce,ir_nec_decoder,ite_cir
snd_timer              28931  2 snd_seq,snd_pcm
wmi                    18744  1 dell_wmi
snd                    62064  20 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_rawmidi,snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
mac_hid                13077  0
soundcore              14635  1 snd
snd_page_alloc         14108  2 snd_hda_intel,snd_pcm
coretemp               13269  0
lp                     17455  0
parport                40930  3 parport_pc,ppdev,lp
tg3                   141369  0
firewire_ohci          40172  0
sdhci_pci              18324  0
firewire_core          56906  1 firewire_ohci
sdhci                  28241  1 sdhci_pci
crc_itu_t              12627  1 firewire_core

lshw
  *-network
       description: Wireless interface
       product: BCM4313 802.11b/g/n Wireless LAN Controller
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:05:00.0
       logical name: eth1
       version: 01
       serial: 70:f1:a1:a9:54:31
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=wl0 driverversion=5.100.82.38 ip=192.168.0.117 latency=0 multicast=yes wireless=IEEE 802.11
       resources: irq:17 memory:f0900000-f0903fff
  *-network
       description: Ethernet interface
       product: NetLink BCM5784M Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:0b:00.0
       logical name: eth0
       version: 10
       serial: b8:ac:6f:71:02:a6
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.121 firmware=sb v2.19 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:48 memory:f0d00000-f0d0ffff

A: edit the following file by entering:
sudo gedit /etc/rc.local
add the lines to disable wlan0 wireless:
sleep 10 (this gives the wireless dongle/card time to to load, before executing the command below)
"iwconfig wlan0 power off"
important! make sure there is a line at the very end that reads:
"exit 0"
this will bypass any errors and allow the system to continue to boot.
you can add other startup commands here as well - very useful.
it should look like this:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sleep 10
iwconfig wlan0 power off
exit 0

http://ubuntuforums.org/showpost.php?p=11254836&postcount=12

A: I had the same problem a few years ago, and I think this should still work: http://uselessuseofcat.com/?p=67

A: The recommended practice is creating (as root) a file (say block-powermanagement) in /etc/pm/config.d/ directory with the line HOOK_BLACKLIST="$HOOK_BLACKLIST wireless".
echo HOOK_BLACKLIST=\"\$HOOK_BLACKLIST wireless\" | sudo tee /etc/pm/config.d/block-powermanagement

should do it.
Sources: https://wiki.archlinux.org/index.php/pm-utils#Disabling_a_hook and some others.


text:
Q: Generic Constructor of class I have the following C# code:
public interface IViewModel {
  PageData Page { get; set; }
}

public class PageData { }

public class ViewModel<T> : IViewModel {

  public PageData PageData { get; set; }
  public T ViewData { get; set; }

  public ViewModel(T viewData, PageData pageData) {
    PageData = pageData;
    ViewData = viewData;
  }
}

Then I use it as follows:
PageData pd = new PageData();
ViewData vd = new ViewData();
ViewModel<MyViewData> model = new ViewModel<MyViewData>(vd, pd);

Is it possible to change my code so I can use it as:
IViewModel model = new ViewModel(vd, pd);

Basically ViewModel would take the type of vd.

A: No, but what you can do is provide a static factory method to make life easier:
public static class ViewModel
{
    public static ViewModel<T> Create<T>(T viewData, PageData pageData)
    {
        return new ViewModel<T>(viewData, pageData);
    }
}

And use it like:
IViewModel model = ViewModel.Create(vd, pd);

A: No, it's not possible. In C#, generics are not implemented by erasure, so every ViewModel you create has to know, at runtime, what its generic type is, at the moment it gets constructed. So the constructor needs to have its generic type, but you can still cast it as an IViewModel without generics.
IViewModel model = new ViewModel<MyViewData>(vd, pd);

As Alex points out, you can use a helper method that will infer the type of the first argument and use that generic type in its new expression.

A: You can make your MyViewData implement an Interface and then:
public class ViewModel : IViewModel {

  public PageData PageData { get; set; }
  public YOURINTERFACE ViewData { get; set; }

  public ViewModel(YOURINTERFACE viewData, PageData pageData) {
    PageData = pageData;
    ViewData = viewData;
  }
}


text:
Q: Cohomology of volume forms If g and h are Riemannian metrics on the same manifold, say both of volume 1, then it follows (I guess from Poincaré duality) that their volume forms dvol_g and dvol_h are cohomologous.
Question: is there some explicitly given (n-1)-form such that
$$d\omega=dvol_g-dvol_h$$

A: Let $n=\dim M$. You can construct an $n$-form on $M\times\mathbb R$ such that pulling it back by the maps $x\mapsto(x,0)\in M\times\mathbb R$ and $x\mapsto(x,1)\in M\times\mathbb R$ gives you your volume forms $\nu_0$ and $\nu_1$. It follows that $\nu_0$ and $\nu_1$ are cohomologous, and most proofs of the homotopy invariance of de Rham cohomology (like that given in Bott-Tu, say) construct explicitly what you want.


text:
Q: How to select descendent elements previously filtered with :not or .not() Guess the following body snippet of HTML DOM:
...

My foo text

My nice text

...

Using jQuery I want to select all
 elements that belong to a parent element of type div.entry and are not a descendent of a div.evil. More precisely: I want to apply a specific class to those "non-evil"
-elements only.
I used the :not selector filter as well as the .not() method for building a chain for selecting appropriate subsets and descendent elements before applying the class as shown here:
$("div.entry div:not(.evil) pre").addClass("pretty");

And alternatively:
$("div.entry").not("div.evil").find("pre").addClass("pretty")

Both variants resulting in matching all pre elements including the ones with an "evil" parent div!
However when I select a direct parent plus class and child like this:
$("div.entry div:not(.some-other-class) > pre").addClass("pretty");

it works like expected. First I thought I misunderstood descendent element selection using element1 element2. Using the chained filter methods without success though proved that something else must be wrong.
The problem itself doesn't sound hard but it now drives me nuts.
Any ideas if and why my way of selecting might be wrong?

A: I'd suggest:
$('div.entry pre').filter(function(){
    return !$(this).closest('div.evil').length
});

JS Fiddle demo.
The advantages, for me, are that you simply select all pre elements, and then reduce those elements based on a (fairly) simple parent-assessment. Alternative approaches work just as well, this is just...my personal preference.

A: Keep it simple:
$('div.entry pre:not(div.evil pre)');

Here you go: jsfiddle demo
Note
So, why
$("div.entry div:not(.evil) pre");

does not work?
When you ask for div:not(.evil), the jQuery guy will return you div.some-other-class as well as div.nice, so that the final selector would be:
$("div.entry div.some-other-class pre, div.entry div.nice pre");

which match even the pre which are descendant of the bad, bad, div.evil!

A: You can use :has selector:
$("div.entry:not(:has(.evil)) pre").addClass("pretty");

http://jsfiddle.net/7BNQN/
Or:
$('div.entry').not(':has(.evil)').find('pre').addClass("pretty");


text:
Q: Null 'key' argument error I'm using IReport 3.5.0 and my java GWT application uses the compiled .jasper file, to create a report. I'm creating the datasource in the java application and use fillReport() method to fill the report. It works fine, it fills the fields that I have defined both in the .jrxml and Java application.
However, I want to use those fields to create a pie chart, and it doesn't work. I give my working fields as key and value expressions for the chart, but when I run the application, it gives the error java.lang.IllegalArgumentException: Null 'key' argument. I couldn't solve it, even when I give $V{PAGE_COUNT} as key expression, it always give the same 'null key' error. I'm stuck. Thanks for any help.

A: I had the same kind of issue. Basically the Pie Chart in JasperReport hates null object. The error message doesn't help very much...
Since you have already check for the key expression, check every other elements. My error was in a label expression!
If you can run your application in a IDE, put a breakpoint on "IllegalArgumentException". It will help you find the root cause. Also make sure the report recompile the jrxml every time you make a change.
Another approach would be to start with an example and modify it to fit your need little by little. You will find the culprit soon enough!
By the way, this has nothing to do with GWT since this all run on the server.

A: I had the same kind of problem with iReport 3.0
I used conditionals to work with null values on key expression and value expression:
($F{FIELDEXPRESSION}!=null?$F{FIELDEXPRESSION}:"")

($F{FIELDVALUE}!=null?(new BigDecimal($F{FIELDVALUE})):(new BigDecimal("0")))

A: I had the same problem. So used a if loop to check if there is a null value in the column i am traversing.
  if(result.get()==null) // result is where is stored my resultset output
 {
    dataset.setValue(count.get(j),"N/A","No Data Available");} // count refers to the number of null entries
       else dataset.setValue(count.get(j),results.get(j),results.get(j));
   }

A: Since I am unable to comment, this might not be a full resolution. I resolved my issue by checking the data types of the fields.
Where I previously had:
<field name="date" class="java.sql.Date"/>

I changed to:
<field name="date" class="java.lang.String"/>

because my field will give me ex:"Jul 15" (FYI which I made it in my query) format type date which can't be java.sql.Date type.


text:
Q: Cannot connect to host. Heroku and discord bot problem I am making a discord music bot with python using wavelink. When I started this app for the first time on my computer it works fine, but yesterday I wanted to deploy it to heroku and it wasn't working, so I was trying to run it again, just on my computer, with the same code and now it's not working at all. I think the code is totally the same like for the first time, but everytime I run the bot there is:

WEBSOCKET | Connection Failure:: Cannot connect to host 127.0.0.1:2333
ssl:default [Komputer zdalny odrzucił połączenie sieciowe] Traceback
(most recent call last):   File
"C:\Python\lib\site-packages\aiohttp\connector.py", line 936, in
_wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa   File "C:\Python\lib\asyncio\base_events.py",
line 1021, in create_connection
raise exceptions[0]   File "C:\Python\lib\asyncio\base_events.py", line 1006, in create_connection
sock = await self._connect_sock(   File "C:\Python\lib\asyncio\base_events.py", line 920, in _connect_sock
await self.sock_connect(sock, address)   File "C:\Python\lib\asyncio\proactor_events.py", line 702, in sock_connect
return await self._proactor.connect(sock, address)   File "C:\Python\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)   File "C:\Python\lib\asyncio\windows_events.py", line 595, in finish_connect
ov.getresult() ConnectionRefusedError: [WinError 1225] Komputer zdalny odrzucił połączenie sieciowe
The above exception was the direct cause of the following exception:
Traceback (most recent call last):   File
"C:\Python\lib\site-packages\wavelink\websocket.py", line 76, in
_connect
self._websocket = await self._node.session.ws_connect(uri, headers=self.headers, heartbeat=self._node.heartbeat)   File
"C:\Python\lib\site-packages\aiohttp\client.py", line 721, in
_ws_connect
resp = await self.request(method, url,   File "C:\Python\lib\site-packages\aiohttp\client.py", line 480, in _request
conn = await self._connector.connect(   File "C:\Python\lib\site-packages\aiohttp\connector.py", line 523, in
connect
proto = await self._create_connection(req, traces, timeout)   File "C:\Python\lib\site-packages\aiohttp\connector.py", line 858, in
_create_connection
_, proto = await self._create_direct_connection(   File "C:\Python\lib\site-packages\aiohttp\connector.py", line 1004, in
_create_direct_connection
raise last_exc   File "C:\Python\lib\site-packages\aiohttp\connector.py", line 980, in
_create_direct_connection
transp, proto = await self._wrap_create_connection(   File "C:\Python\lib\site-packages\aiohttp\connector.py", line 943, in
_wrap_create_connection
raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host
127.0.0.1:2333 ssl:default [Komputer zdalny odrzucił połączenie sieciowe]

I think the problem is with this part of code:
async def start_nodes(self):
        await self.bot.wait_until_ready()

        # Initiate our nodes. For this example we will use one server.
        # Region should be a discord.py guild.region e.g sydney or us_central (Though this is not technically required)
        await self.bot.wavelink.initiate_node(host='127.0.0.1',
                                              port=2333,
                                              rest_uri='http://127.0.0.1:2333',
                                              password='youshallnotpass',
                                              identifier='TEST',
                                              region='europe')

File application.yml looks like that:
server: # REST and WS server
  port: 2333
  address: 0.0.0.0
lavalink:
  server:
    password: "youshallnotpass"
    sources:
      youtube: true
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      mixer: true
      http: true
      local: false
    bufferDurationMs: 400
    youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
    playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
    youtubeSearchEnabled: true
    soundcloudSearchEnabled: true
    gc-warnings: true
    #ratelimit:
      #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
      #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
      #strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
      #searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
      #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times

metrics:
  prometheus:
    enabled: false
    endpoint: /metrics

sentry:
  dsn: ""
  environment: ""
#  tags:
#    some_key: some_value
#    another_key: another_value

logging:
  file:
    max-history: 30
    max-size: 1GB
  path: ./logs/

  level:
    root: INFO
    lavalink: INFO

Do you have any ideas?
SOLUTION: Okay, if you have the same problem as me and you are using Lavalink, you have to start the Lavalink server at first. In my case, I have to type in terminal "java -jar Lavalink.jar" to start the server.

A: I was facing the same problem but then i figured it out
you need to setup Lavalink

*

*Download OpenJDK 13.0.2 and then extract

*Download Lavalink

*Paste Lavalink.jar inside bin from the 1st step

mv ./Lavalink.jar ./open-jdk/bin

*create a new file application.yml and paste this code
- make sure to change address: 0.0.0.0 to address: 127.0.0.1
server: # REST and WS server
  port: 2333
  address: 127.0.0.1
lavalink:
  server:
    password: "youshallnotpass"
    sources:
      youtube: true
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      http: true
      local: false
    bufferDurationMs: 400
    youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
    playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
    youtubeSearchEnabled: true
    soundcloudSearchEnabled: true
    gc-warnings: true
    #ratelimit:
      #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
      #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
      #strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
      #searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
      #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times

metrics:
  prometheus:
    enabled: false
    endpoint: /metrics

sentry:
  dsn: ""
  environment: ""
#  tags:
#    some_key: some_value
#    another_key: another_value

logging:
  file:
    max-history: 30
    max-size: 1GB
  path: ./logs/

  level:
    root: INFO
    lavalink: INFO

*go to command prompt and execute below command

pip install discord.py[voice] wavelink

*open the folder where you extracted JDK  and then type

java -jar Lavalink.jar

this will start the lavalink server and then you will be able to use your bot

for more help check out this video


text:
Q: JavaFX Binding Simple Example I am writing a simple program to bind the values of a ChoiceBox to the font value of the Label node. However, I am unable to do that.
The Application
package mybinding;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.SceneBuilder;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ChoiceBoxBuilder;
import javafx.scene.control.Label;
import javafx.scene.control.LabelBuilder;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.GridPaneBuilder;
import javafx.stage.Stage;

public class SimpleBindingMain extends Application{

    Label simpleLabel;
    ChoiceBox availableFonts;
    GridPane gridPane;
    SimpleBindingModel model = new SimpleBindingModel();
    Scene scene;

    @Override
    public void start(Stage stage) throws Exception {
        availableFonts = ChoiceBoxBuilder
                        .create()
                        .items(model.fonts)
                        .build();
        simpleLabel = LabelBuilder
                    .create()
                    .text("Font Preview")
                    .font(model.theFont)
                    .build();

        gridPane = GridPaneBuilder.create().build();
        gridPane.add(simpleLabel,0,0);
        gridPane.add(availableFonts,0,1);

        model.fontSelectionModel = availableFonts.getSelectionModel();
        model.addFontSelectionListener();

        scene = SceneBuilder
                .create()
                .root(gridPane)
                .build();

        /**
         * ADD BINDING CODE
         */

        stage.setScene(scene);
        stage.sizeToScene();
        stage.show();

    }

    public static void main(String[] args) {
        Application.launch("mybinding.SimpleBindingMain");
    }
}

The Model
package mybinding;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.SingleSelectionModel;
import javafx.scene.text.Font;

public class SimpleBindingModel {
    public StringProperty string = new SimpleStringProperty(); // the actual text
    public IntegerProperty textSize = new SimpleIntegerProperty(); // the size of the text
    public ObservableList fonts = FXCollections.observableArrayList( // possible fonts
                "DejaVu Sans Mono",
                "Nimbus Sans L",
                "Ubuntu",
                "Ubuntu Condensed"
            );
    public Font theFont = Font.font("DejaVu Sans Mono",18); // default font
    public SingleSelectionModel fontSelectionModel;

    public void addFontSelectionListener(){
        fontSelectionModel.selectedIndexProperty().addListener(new ChangeListener(){
            @Override
            public void changed(ObservableValue value, Object oldValue, Object newValue) {
                int selectedFontIndex = fontSelectionModel.selectedIndexProperty().getValue();
                theFont = Font.font((String)fonts.get(selectedFontIndex),12);
            }
        });
    }
}

Please help me out with the binding code.

A: You are almost there :-). Just some little modifications are required.
At first, change the SimpleBindingModel.theFont property type to ObjectProperty<Font>, allowing the SimpleBindingMain.simpleLabel.fontProperty to be bound to it.
In this case, the property declaration would be:
public ObjectProperty<Font> theFont = new SimpleObjectProperty<Font>(Font.font("DejaVu Sans Mono",18));

After that, you need to change the points where theFont is read/set. For example, at the font selection listener:
public void addFontSelectionListener(){
    fontSelectionModel.selectedIndexProperty().addListener(new ChangeListener(){
        @Override
        public void changed(ObservableValue value, Object oldValue, Object newValue) {
            int selectedFontIndex = fontSelectionModel.selectedIndexProperty().getValue();
            // old code: theFont = Font.font((String)fonts.get(selectedFontIndex),12);
            theFont.set(Font.font((String)fonts.get(selectedFontIndex),12));
        }
    });
}

Finally, you can bind the simpleLabel.fontProperty to theFont:
simpleLabel.fontProperty().bind(model.theFont);


text:
Q: SyntaxError: node_modules/angular2/ts/package.json: Unexpected token < I develop sails app with angular 2 I setup ,but I got error in
SyntaxError: /home/mts/Desktop/sampleProject/appSails/node_modules/angular2/ts/package.json: Unexpected token <
at Object.parse (native)
at Object.Module._extensions..json (module.js:430:27)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at /usr/local/lib/node_modules/sails/node_modules/include-all/index.js:129:29
at Array.forEach (native)
at requireAll (/usr/local/lib/node_modules/sails/node_modules/include-all/index.js:44:9)
at /usr/local/lib/node_modules/sails/node_modules/include-all/index.js:54:23

How can I solve that scenario how to up sails server ?

A: Your problem(which was also mine) is that angular2 is a clientside package,a package named incluede-all tries to  include all node_module files within a directory for sails. i solved this problem by adding an array of clientsideDependencies to package.json
 "clientsideDependencies": [
      "angular2","zone.js","rxjs"
   ],

then i forked include-all package and write a code to pass this packages
here is my fork
you can use this fork it works without any problem just change the source of include-all at package.json  to :
"include-all": "https://github.com/semirturgay/include-all.git"

then run  npm install to update include-all


text:
Q: How binary numbers are evaluated for true or false? if i write
PORTA =0b00000001;
PORTB =0b00000000;
PORTC =0b11111111;
PORTD =0b10100110;
if(PORTA){
//will this block be true?if yes then why and how it is evaluated
}
if(PORTB){
//smae here,to check true or false.
}
if(PORTC){
//if true then why or false,why?
}
if(PORTD){
//same
}

if above statement are wrong then how to check the status of a port?

A: Normally in C, any non-zero number will evaluate to true. If you want to check the value of a specific bit in your port, use the binary-AND operator &. Note: Logical AND, &&, and binary AND, &, are not the same thing.
In your question, only PORTB will evaluate to false.


text:
Q: is this assert for development not for production? I try to understand what assert it is. Every answer say it is debugging stuff. I confused. Should not we use it in production?  Should we remove it after the developlement? If assertions are disabled in the Python interpreter. Asserts will be ignored and that can become a security risk? We just use it try to make easy debug on development?
if it is for production. below example i used assert to control not having negative value. Why don't i use if else instead assert?
Thank you in advance.
def get_age(age):
   assert age > 0, "Age can't be negative!"
   print("your age is"+age)

A: If nothing else, you lose control over the behavior of get_age using assertions, because they can be disabled at runtime without modifying the code itself. For production usage, be more explicit and raise a ValueError (or, if you deem it worth the effort, a custom subclass of ValueError):
def get_age(age):
   if age <= 0:
       raise ValueError("Age can't be nonpositive!")
   print("your age is" + str(age))

A: Assert Statements are used when:

*

*the final code is in theory fail safe

*the current state of the code is not yet fail safe

E.g. You programm a game with a moving car. Let's say you have a really complicated move() function that works absolutely fine for positive input but in special cases bugs out in weird ways for negative input.
You know this function is going to be fine in the final stage of your game as no function part of the game will every call move() with negative input.
But as you are currently still working on an A.I. driving the car so that you can race against bots - you cannot gurantee that you didn't make a mistake and the A.I. calls the move() function with negative input.
Therefore you put an assert input_arg >= 0 at the beginning of your move() function so that you get notified everytime a wrong input arg was given.
try-except will not catch this as your movement only bugs out but does not raise an exception.
So the assert input_arg >= 0, 'input_arg must be positive!' is just shorthand for if not (input_arg >= 0): raise ValueError('input_arg must be positive!') while signaling that this is not an actual error that can occur in the final stage of the code but only while developing other parts of the game.
It is shorter, can be differentiated from 'real' errors and therefore also automatically stripped away for production code.


text:
Q: Value set by h:selectOneMenu is null in f:ajax listener method I'm trying to use AJAX in my JSF 2.0 web application and have a problem with getting current value from selectOneMenu.
Part of my JSF page.
<h:panelGrid columns="2">
<h:outputLabel value="Appendix number" for="appendix" />
<h:selectOneMenu id="appendix" value="#{indexMBean.appendix}">
<f:selectItem itemLabel="Point 1" itemValue="1" />
<f:selectItem itemLabel="Point 2" itemValue="2" />
<f:ajax event="change" listener="#{indexMBean.setHazardsByAppendix}" />
</h:selectOneMenu>
</h:panelGrid>

setHazardsByAppendix is a procedure in indexMBean. Then the procedure fires I try to get the current value of h:selectOneMenu for passing it on another procedure.
public void setHazardsByAppendix() {
    Logger logger = Logger.getAnonymousLogger();
    logger.warning(this.appendix);
    this.setHazards(this.hazardSessionBean.getHazardByAppendix(this.appendix));
}

But the current value of field appendix is always null. How is this caused and how can I solve it?

A: Solved in a very strange way. I created a new netbeans project with the same sources. And amazingly it works fine.
It's a really strange but it works.

A:    `<f:ajax execute="@this" listener="#{templateSearchHandler.OnDefNameSelect}">
 void setHazardsByAppendix(AjaxBehaviorEvent event) {
    Logger logger = Logger.getAnonymousLogger();
    logger.warning(this.appendix);
    this.setHazards(this.hazardSessionBean.getHazardByAppendix(this.appendix));
}`

A: This code calls AjaxBehaviour event and pass value to controller through Ajax.
<h:panelGrid columns="2">
<h:outputLabel value="Appendix number" for="appendix" />
<h:selectOneMenu id="appendix" value="#{indexMBean.appendix}">
<f:selectItem itemLabel="Point 1" itemValue="1" />
<f:selectItem itemLabel="Point 2" itemValue="2" />
<f:ajax execute="@this"listener="#{indexMBean.setHazardsByAppendix}" />
</h:selectOneMenu>
</h:panelGrid>
//Controller
public void setHazardsByAppendix(AjaxBehaviorEvent event) {
    Logger logger = Logger.getAnonymousLogger();
    logger.warning(this.appendix);
    this.setHazards(this.hazardSessionBean.getHazardByAppendix(this.appendix));
}


text:
Q: Different margin of div's are not working I want to make circles using divisions and each circle has different margin. The problem is that the div with small margin-top affects with the largest margin top for another div.
here's the HTML:

and here's the CSS:
div.circle{

display: inline-block;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-o-border-radius: 100px;
-ms-border-radius: 100px;
border-radius: 100px;
background: pink;
opacity: 0.3;
margin-top: 0px;

}
div.size1{
   width:120px;
   height:120px;
}

div.size2{
   width:130px;
   height:130px;
}

div.marginTop1{
    margin-top: 20px;
    margin-right:-10px;
}
div.marginTop2{
 margin-top: 140px
 }

Here's the code:
http://jsfiddle.net/L6gPd/
The div with small margin-top affects with large margin top.
Any explanation please?

A: It's not entirely clear from your question, but are you trying to get them to be different heights vertically?  If so, would try adding
vertical-align:top; to the marginTop1 and marginTop2 classes so the margin-top values will take visible effect.

A: If you want to place them side by side then add float:left; to div.circle.
If you inspect the element using Firebug or Chrome Developer Tools, you will see that the 2nd circle is having margin-top of just 20px but it is relative to the position of the 1st circle and not from the top of the page.


text:
Q: Microphone problems Kubuntu I have a quite fresh installation of Kubuntu but I can't make my microphone work properly. When I try to record something and listen to the result, what I hear is only noise such as a broken microphone. I think nothing is broken since my laptop is brand new (it is a lenovo notebook essential V145-15AST).
I tried to play with settings in pavucontrol and alsamixer with no luck.
If it can help, these are the current settings:

P.S. I didn't test the microphone with another operating system since this was a free dos laptop and Kubuntu is the first OS I installed.

A: For those who have the same problem, I solved it:
in pavucontrol click on the tab "Input Devices", then click on the icon of a lock.  You'll find the volume for left and right microphones separately. Set one of them to zero


text:
Q: Get the named of Collections from Document on Cloud Firestore I want to get collections (Col01, Col02, Col03) from the document (Doc01). How can I approach this? Check the attached image. Thanks.

A: There is no API for getting a list of collection names that exist within your (Doc01) document. So, unfortunately, you cannot do that on Android. Because you are looking for sub-collections that are nested under a document, the only option that you have is to use DocumentReference's listCollections() function but is currently available only for Node.js admin clients.
The simplest solution I can think of is to create a collection with a single document, in which you should add an array that contains the names of all sub-collections that exist under your (Doc01) document. To display those names is at simple as displaying the content of a List in Java. This solution will work not only for Android, but for all platforms.


text:
Q: How to create ZIP in PHP only if files have changed? I have a page on a training site which displays several downloads whose ids are pulled from a database. At the bottom, I've successfully coded to have all of those files compressed into a zip for download.
However, each time the page loads, the zip is recreated and overwrites the previous zip file. As you can imagine, this causes some load time that is less than desirable.
I'm wondering how I can make PHP check to see if any of the files have changed since the last page load (last view opened the page), and if so, then recreate the zip and overwrite.
Looking through PHP docs, it seems filemtime() might have something to do with it, but I have no experience with that and am not even sure I can use it on a website. Looking into it more, I'm fearing I might need to involve caching, which I also have no experience with.
Any help, suggestions or leads would be very helpful. Let me know if I can make more sense or provide any of my existing code as background.

A: For indexation purposes, I'm leaving the answer here.
You can set the filename to equal the last timestamp of the returned filemtime() date when the file was last changed, thus being able to compare the current timestamp with the filename itself. It might force you to break the zip folder structure into something more complex to avoid colisions, but then again you can also make the filename something like :
$timestamp = time();
$id = uniqid();
echo "Filename : {$timestamp}-{$id}.zip";

A: I'm sure the solution provided by Yoda would have worked, but I went for (what I think) a simpler solution.
For my purposes, I needed to keep the zip file names constant over time (couldn't place the timestamp in the filename). Instead, I gathered the latest timestamp from the files using filemtime(). I then compared those to the timestamp of my zip file. If the zip time was less recent, the zip was nonexistent, or the number of files in the list didn't match the number in the zip, I recreated the zip, otherwise, I just showed the zip.
My situation is a bit unique as I am storing and displaying the downloadable files via a wordpress plugin (Download Monitor). Here's basically what I did though:
/*Functions*/

//Convert url to absolute path
function url2path($url){
    $parsed = parse_url($url);
    if(!is_array($parsed)) return false;
    $path = $_SERVER['DOCUMENT_ROOT'].$parsed['path'];
    return $path;
}
//Returns the highest number (works with Unix Timestamps)
function get_highest_number($numbers){
    if(!is_array($numbers)) return false;
    $highest = $numbers[0];
    foreach($numbers as $number) if($highest < $number) $highest = $number;
    return $highest;
}

$dtimes = array();
foreach($dl as $d) { //iterate through my array of downloads
    $dtimes[] = filemtime(url2path($d->filename));
    //$dtimes is an array containing all the unix timestamps of my downloads
    //other code to display individual downloads, etc
}

//Zip Details
$uploads = wp_upload_dir();
$parent = get_page($post->post_parent);
$zip_url = $uploads[baseurl].'/downloads/zips/'.$parent->post_name.'_'.$post->post_name.'.zip';

if($dtimes){
    $latesttime = get_highest_number($dtimes); //latest UNIX timestamp of files
    //If ZIP already exists, get timestamp of when ZIP was created
    //I create the ZIP file name from the page title and store them all in 1 directory, thus, I would have to know the full zip filename to retrieve it.
    if($ziptime = filemtime(url2path($zip_url))){
        $zip = new ZipArchive();
        $zip->open(url2path($zip_url));

        //If ZIP timestamp is more recent than file, show ZIP
        if($ziptime > $latesttime && $zip->numFiles == count($dtimes)) $result = url2path($zip_url);
        else $result = cat has create_zip($downloads,$zip_url,true);
    }
//If ZIP doesn't exist or ZIP timestampe is less recent than files, create/rewrite ZIP
    else $result = create_zip($downloads,$zip_url,true);
    //regardless of what has happened, $result should now hold the path to the zip archive.
}

Hope this can help someone with a similar question. If you're interested in a demo, almost any page in the 'Training Library' utilizes this code (i.e. http://chesapeakestormwater.net/training-library/all-about-stormwater/impervious-cover-and-stream-health/)


text:
Q: Drupal: Showing nodes related to a profile when a cck field of those nodes have the profile nodeid of that user I need to show all nodes of a specific nodetype, related to the profile node of each user, inside a certain page.
This is what I have:

*

*Users with their userids (example uid A)

*A Profile node for each user (example nodeid B)

*Several reg nodes with a cck field that contains the nodeid of the profile node (example cck field C)

I need to show inside a page all reg nodes that have inside that cck field B the nodeid A.
For each user. So I enter a page usersregnodes/uidA and see all regnodes that are related to that user because in their cck field C they´ve got the node nodeidB that´s the profile nodeid of that user.
I´m struggling with relationships and arguments.
So far, I think that I should create a relationship Node:Content Profile.
The filter should be the reg nodetype.
And the argument should be the userid (?).
I can´t make this work, because all combinations and try and error that I´ve tried results in blank results.
I would really appreciate your help!
THANKS!
Rosamunda

A: You could use a view to get this done. The trick is to change the argument validation.
If I got it right you need to pass the uid as an argument to a view, but get the nodes that reference the nid of content profiles of that particular uid.
To achieve this you need to build a view and set an argument with a custom validator.
Build the view as follows:

*

*It's a node view;

*Set up an argument. Choose the node reference field that contains the nid for your argument;

*In the argument configuration screen, look for "validator options";

*Select "PHP code" instead of "Basic Validation";

*Use the following code (don't use php opening and closing tags):
$prev_arg = $handler->argument;
$handler->argument = content_profile_load('content_type_name', $prev_arg)->nid;
return $handler->argument;

This way you should be able to change the value of the argument from the uid into the content profile nid and get the results of the view filtered by the nid.


text:
Q: inline function in namespace generate duplicate symbols during link on gcc I have a namespace with inline function that will be used if several source files.
When trying to link my application, the inline function are reported as duplicate symbols.
It seems as if my code would simply not inline the functions and I was wondering if this is the expected behavior and how to best deal with it.
I use the following gcc options:
-g -Wextra -pedantic -Wmissing-field-initializers -Wredundant-decls -Wfloat-equal -Wno-reorder -Wno-long-long
The same code style seems to compile and link properly when build in a VC7 environment.
The following code example shows the structure of the code:
/* header.h */
namespace myNamespace {
inline bool myFunction() {return true;}
}

/* use_1.cpp */
#include "header.h"
...
bool OK = myNamespace::myFunction();
...

/* use_2.cpp */
#include "header.h"
...
bool OK = myNamespace::myFunction();
...

A: Delete the build directory for the dll/exe and recompile.
There is possibly some problem with the build. It could be pre-compiled headers as alluded to by the OP in a comment above. I had exactly the same problem and deleting the build directory and recompiling solved it.

A: The inline keyword is taken only as a hint by the compiler. If the compiler decides that the function would be better performing without inline, it will not inline it. There are vendor-specific keywords that make the compiler inline a function - it is __attribute__((always_inline)) for GCC and __forceinline for Visual C++.
If you really want to make sure your function won't be causing linker errors in all cases on all standard compilers, you might want to make it templated, as templated functions are guaranteed not to cause linker errors even if defined in headers. This is, however, quite unnecessary for really simple functions.


text:
Q: Searching SQLite3 database with WHERE clause My code:
   name1 = name_entry.get()
    conn = sqlite3.connect('test123.db')
    c = conn.cursor()
    c.execute("SELECT * FROM table123 WHERE name = name1")
    print(c.fetchall())
    conn.commit()
    conn.close()

Error:
sqlite3.OperationalError: no such column: name1

My question
How do I use a variable with WHERE caluse to find the desired tuples ?

A: You should substitute the variable name1 value in your c.execute statement. Do this:
c.execute("SELECT * FROM table123 WHERE name = {}".format(name1))

OR:
c.execute("SELECT * FROM table123 WHERE name = ?", name1)


text:
Q: How to intercept SAML response in a WebView? I have a use case where I would like to get the SAML Response(assertion) from IdP by intercepting (in the web browser) the javascript redirect (HTTP POST binding)to SP. The SAML response that's captured will then be sent to the SP programatically.
I have already looked at Android bug - cannot access request POST headers


text:
Q: Leaflet - about setView and LatLng cordinates of the tileLayerimages Im working on a game. And i use Leaflet as a gamemap. And the code for the map is here:
http://pastebin.com/uFNi75kk
I use:
var london = new L.LatLng(-35, 20);
_map.setView(london, 3);
...to load view on map. It loads the Latitude / Longidute (LatLng)
Now i want to get the LatLng cordinates of the images/tileLayers leftTop Corner that is loaded by image.php Because i want to center the screen near the gameusers castle writen on the map with image.php.
Is there a way to get the LatLng cordinates fot the image (tileLayer) ?
There is no id or name for the tileLayer so i dont know how to do this..
How should i do this? I need help!
Best Regards


text:
Q: wkhtmltopdf: How can I use a file or text with footer-html? I'm using wkhtmltopdf to convert an html template into a pdf, and I want to use some html as a footer, but as far as I can tell I have to make the html a webpage, which means it would be visible to the public. So I have two questions:

*

*Is there any way to use a string or a file with footer-html?

*If not, is there any way to prevent the footer webpage from being visible to the public? I'm using flask to make my website.

A: I found an answer. I used 'footer-html': url_for(...) to get the path to the file. In the file I also had to change the css path (I used url_for, but wkhtmltopdf doesn't understand jinja). So I changed it to a static file path.


text:
Q: PHP switch: calculate dates I made this switch, but I dont know this last step (the ?? and the comments).
If someone can help me, thanks a lot!
<?
   $nuDatumTijd = date("Y-m-d H:i:s");
   $nuUur = date("H");
   switch(true)
   {
      case $nuUur > 8 && $nuUur < 13:
      $aantSecErbij = ??; // number of seconds untill the first next 13:00
      $weerOp = date($nuDatumTijd,$aantSecErbij);
      echo $weerOp;
      break;

      case $nuUur > 12 && $nuUur < 18:
      $aantSecErbij = ??; // number of seconds untill the first next 19:00
      $weerOp = date($nuDatumTijd,$aantSecErbij);
      echo $weerOp;
      break;

      case $nuUur > 17 && $nuUur < 22:
      $aantSecErbij = ??; // number of seconds untill the first next 9:00 (so that is the next day)
      $weerOp = date($nuDatumTijd,$aantSecErbij);
      echo $weerOp;
      break;
   }
?>

A: I now have fixed it this way, thanks for your input:
$nuUur = date("H");

        if ($nuUur > 8 && $nuUur < 13)
        {
            $weerOp = strtotime('today 13:00');
            $weerOpNetjes = date('Y-m-d H:i:s', $weerOp);
            echo $weerOpNetjes;
        }
        elseif ($nuUur > 12 && $nuUur < 18)
        {
            $weerOp = strtotime('today 19:00');
            $weerOpNetjes = date('H:i', $weerOp);
            echo $weerOpNetjes;
        }
        elseif ($nuUur > 17 && $nuUur < 22)
        {
            $weerOp = strtotime('tomorrow 9:00');
            $weerOpNetjes = date('H:i', $weerOp);
            echo $weerOpNetjes;
        }

A: switch-case can be used this way too, no problem about that.
$aantSecErbij = ??; // number of seconds untill the first next 13:00

If this means the number of seconds until today's 1pm then the following will get you the timestamp of today's 1pm.
$now = getdate();
$time1pm = mktime(13, 0, 0, $now['mon'], $now['mday'], $now['year']);

If it means the number of seconds between now and today's 1pm then you need to subtract with current timestamp.
$now = getdate();
$diff1pm = mktime(13, 0, 0, $now['mon'], $now['mday'], $now['year']) - time();

.
$aantSecErbij = ??; // number of seconds untill the first next 9:00 (so that is the next day)

For the next day you can add 1 to the day part and don't have to worry about the end of month. PHP will figure out the right date for you.
$now = getdate();
$tomorrow9am = mktime(9, 0, 0, $now['mon'], $now['mday'] + 1, $now['year']);


text:
Q: Does the goinstant api handle reconnecting if the connection is lost? Does the goinstant connection automatically handle reconnection in case of disconnection?
I can't find any indication of this in the docs.

A: Yes, GoInstant reconnects automatically, but that appears to be a hole in our documentation.
Internally, the GoInstant client implements a capped Fibonacci back-off sequence (in milliseconds):
[100,100,200,300,500,800,1300,2100,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000,3000]

Each time the connection drops, that sequence of reconnects is attempted.  Once it reaches the end of that sequence (approx 41 seconds later), the connection is considered dead and you get a goinstant.ConnectionError object passed via the .on('error') event of the Connection object.
The error classes are documented here: https://developers.goinstant.com/v1/javascript_api/connection/errors.html


text:
Q: How to pass a model between reactive functions in R Shiny? I'm new to R Shiny, so please bear with me. I'm trying to create an interactive model, which works something like this:

*

*The user sets some parameters using a slider/push buttons and hits "button1". That generates the model.

*User can then select some inputs and push "button2" to get predictions based on the model they just generated.

Ideally, it would look something like this:
server <- function(input, output, session){

observeEvent(input$button1, {
# generate the model, model <- lm(...)
# pass general information about the model to the UI (R's "summary")
})

observeEvent(input$button2, {
# create predictions using model and output them to the UI
})

}

But of course model goes out of scope and can't be used in the second observeEvent. I'm just trying to figure out how to get around this, and I can't seem to find an answer.

A: As suggested in the comments, instead of observeEvent, try making your model a reactive function:
model <- eventReactive(input$button1, {
  # generate the model, tempvariable <- lm(...)
  # pass general information about the model to the UI (R's "summary")
  # Put the model in the last line so that it becomes the return value of the reactive function
  tempvariable
})

observeEvent(input$button2, {
  # create predictions using model and output them to the UI
  # here you can refer to the model by calling it model(),
  # e.g., anova(model()) or temp <- model(), anova(temp)
})


text:
Q: LDA for statistical test I was searching for which statistical test to use when:

*

*The dependent (target) variable is discrete.

*The independent variable is continuous.

I stumbled onto this table:
https://www.analyticsvidhya.com/wp-content/uploads/2016/11/FS1.png
which states that you should use an LDA in this case. However I couldn't find any case where someone has used it for something similar and it's unclear to me how this should work. So my question is:
How do you use LDA as a statistical test?
If this doesn't work could you point me out to a statistical test for the case I'm looking for? Other sources I've read conveniently overlook this case...


text:
Q: MySql rows with NULL values are not retriving in select query I am having a strange issue with a simple select query and unable to find what is happening. I am using below sql to fetch some records from a customer table. My query is as follows.
SELECT `C`.* FROM `customers` AS `C` WHERE `C`.`typeId`!=9 ORDER BY C.name ASC

My table structure is as follows
|id|name|typeId|
|1 |abc |1     |
|2 |abcd|9     |
|3 |xxxx|NULL  |
|4 |qwe |NULL  |
|5 |xvf |10    |

in the above table, typeId is an integer field and default NULL. Database is MySql
When I am executing the above mentiond SQL, I am getting all other rows except typeId=9 and typeId = NULL. My question is why typeId=NULL is getting omitted from the result? I have googled a lot and unable to find any answer. Am i doing anything wrong here?

A: try out this...
SELECT `C`.*
FROM `customers` AS `C`
WHERE `C`.`typeId`!=9
   OR `C`.`typeId` IS NULL
ORDER BY C.name ASC

A: Try this

SELECT C.* FROM customers AS C WHERE C.typeId!=9 OR C.typeId IS  NULL ORDER BY C.name ASC

A: Because NULL is equivalent to UNKNOWN, and when you compare a value with UNKNOWN, the result will always be false.
If you want to fetch the records containing NULL, you need to re-write your query this way -
where `C`.`typeId` <> 9
OR `C`.`typeId` is null;

A: NULL doesn't compare equal to anything. You'll need to accept nulls explicitly: Just add
AND C.typeId IS NOT NULL

in the query also
see the NULL working over here http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
Check the below question too :- NULL values in where clause

A: You can use
SELECT id,
       name,
       COALESE(typeId,0) AS type
FROM customers AS C
WHERE C.type!=9
ORDER BY C.name ASC


text:
Q: Ansible - Run playbooks using systemd (.service files) I would like to start an ansible playbook through a service.
Problem is that there is an exception occurring if i try to start a specific playbook with the help of a .service file.
Normal execution via the command line doesn't throw any exceptions.
The exact error is as follows:

 ESTABLISH LOCAL CONNECTION FOR USER: build

 EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /tmp"&& mkdir "echo /tmp/ansible-tmp-1628159196.970389-90181-42979741793270" && echo ansible-tmp-1628159196.970389-90181-42979741793270="echo /tmp/ansible-tmp-1628159196.970389-90181-42979741793270" ) && sleep 0'
fatal: [Ares]: UNREACHABLE! => changed=false

msg: 'Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "echo /tmp"&& mkdir "echo /tmp/ansible-tmp-1628159196.970389-90181-42979741793270" && echo ansible-tmp-1628159196.970389-90181-42979741793270="echo /tmp/ansible-tmp-1628159196.970389-90181-42979741793270" ), exited with result 127'

unreachable: true'

I've tried the following:

*

*Authentication or permission failure, did not have permissions on the remote directory

*https://github.com/ansible/ansible/issues/43830

*Generally searching for an answer, but all i could find is to change remote_config to /tmp

*Changing the permissions to 777 for the /tmp folder

*Changing the user for the service to both build and root

*Changing the group for the service to both build and root
Current configuration:
The remote_tmp is set to /tmp
The rights for /tmp are: drwxrwxrwt. 38 root  root
This is the service i am starting:
[Unit]
Description=Running vmware in a service
After=network.target

[Service]
User=build
Group=build
WorkingDirectory=/home/build/dev/sol_project_overview/ansible-interface
Environment="PATH=/home/build/dev/sol_project_overview/ansible-interface/venv/bin"
ExecStart=/home/build/dev/sol_project_overview/ansible-interface/venv/bin/ansible-playbook ./playbooks/get_vm_data_playbook.yml --vault-password-file password.txt -vvv

[Install]
WantedBy=multi-user.target

The exact ansible task that throws this exception:
- name: Write Disks Data to file
  template:
    src: template.j2
    dest: /home/build/dev/sol_project_overview/tmp/vm_data
  delegate_to: localhost
  run_once: yes

Also normally I would run a python script via this service file, that would call ansible when special conditions are met. But the same error occurs with a python script started by the service.
All of this lets me think that the problem is with the .service file... i just don't know what.
Any help is appreciated.
EDIT: SELinux is disabled

A: So i found the problem:
When debugging with -vvvv => 4 * verbose you get an even more precise error message:

"msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "echo /tmp/.ansible/tmp"&& mkdir "echo /tmp/.ansible/tmp/ansible-tmp-1629205650.8804808-397364-56399467035196" && echo ansible-tmp-1629205650.8804808-397364-56399467035196="echo /tmp/.ansible/tmp/ansible-tmp-1629205650.8804808-397364-56399467035196" ), exited with result 127**, stderr output: /bin/sh: mkdir: command not found\n",**

and in the last part there is this information:, stderr output: /bin/sh: mkdir: command not found\n",
So after googling i realized the problem was with that "PATH" variable I am setting in my .service file.
This was the problem:
Environment="PATH=/home/build/dev/sol_project_overview/ansible-interface/venv/bin"

it couldn't find mkdir because the "bin" folder, where "mkdir" is located at, wasn't specified in the "PATH" variable
What was left to do is to change the PATH variable of the service correctly. In order to do so I took the the PATH variable from the corresponding virtual environment when it was active.
Lesson: If you are working with virtual environments and want to use services using their environments, then change the PATH variable to that of the virtual machine.


text:
Q: Name of 'rule for sequential possessive' I've been unable to successfully search for or determine the name of this scenario that involves multiple possessive words in sequence.
We purchased some flowers for the mother of our friend, Jane. I would like to say,

"Here are Jane's mother's flowers."

Is there a name for this construction (not 'compound' or 'joint' possessive since the word "and" is not used)? Is this an unfortunate choice of wording that should be replaced with some other phrasing?

A: It's contrived, like:

How can you put the word "and" 5 times in a row in the same sentence? I need to tell a story. The landlord of a pub called The Pig And Whistle asked a signwriter to make a new sign. When he saw it he thought that the words were too close together so he said to the signwriter "I want more space between Pig and And and And and Whistle".

The shopkeeper should just say 'Jane's flowers' as they are until Jane gives them to her mother, along with the receipt no doubt!