Snippet 1:  class Room(Object):       pass    Snippet 2:  class Room():       pass   What is the different between both of the code and why we write object in the above code?
What is the difference between old style and new style classes in Python?  When should I use one or the other?
Testing Classification on Oversampled Imbalance Data I am working on severely imbalanced data. In literature, several methods are used to re-balance the data using re-sampling (over- or under-sampling). Two good approaches are:   SMOTE: Synthetic Minority Over-sampling TEchnique () ADASYN: Adaptive Synthetic Sampling Approach for Imbalanced Learning ()   I have implemented ADASYN because its adaptive nature and ease to extension to multi-class problems.  My question is how to test the oversampled data produced by ADASYN (or any other oversampling methods). It is not clear in the mentioned two paper how they performed their experiments. There are two scenarios:  1- Oversample the whole dataset, then split it to training and testing sets (or cross validation).  2- After splitting the original dataset, perform oversampling on the training set only and test on the original data test set (could be performed with cross validation).  In the first case the results are much better than without oversampling, but I am concerned if there is overfitting. While in the second case the results are slightly better than without oversampling and much worse than the first case. But the concern with the second case is if all minority class samples goes to the testing set, then no benefit will be achieved with oversampling.  I am not sure if there are any other settings to test such data. check if numbers from command line are powers of 2 How to use notify-send to notify users as root? #!/bin/bash export DISPLAY=:0 state=$(upower -i $(upower -e | grep BAT) | grep --color=never -E "state" ) stat=${state:25:32} batperct=$(upower -i $(upower -e | grep '/battery') | grep  -E "percentage:") bat=${batperct:24:26} intbat=$(echo $bat | cut -d'%' -f1) if [ "$intbat" -lt "15" -a "$stat" == "discharging" ]; then     notify-send 'battery low..! please plugin charger..... charge is only' "$intbat"     fi     The script runs fine when run as a normal user (bash script.sh). The desktop notification is displayed.  If I run it as root with sudo bash script.sh, the desktop notification is not displayed.  How can I use notify-send to notify users as root?  I am using Arch Linux. show that $a^2+b^2+c^2+2abc+3\ge (1+a)(1+b)(1+c)$ let $a,b,c&gt;0$. Show that   $$a^2+b^2+c^2+2abc+3\ge (1+a)(1+b)(1+c)$$   By the $$(1+a)(1+b)(1+c)=1+a+b+c+ab+bc+ac+abc$$ it is suffient to show  $$a^2+b^2+c^2+abc+2\ge a+b+c+ab+bc+ac$$ How? I have heard that some issues in group theory prevent classifying all manifolds upto homotopy using the fundamental group invariant. Does anyone know what are those issues?  Thanks, K. Alternate Row Coloring in Django Template with More Than One Set of Rows component.set not working for picklist field I have a number of lightning:inputField that i'm setting based on certain criteria, these all work except for picklist field types. The code below shows how i am setting the fields. The country field is the picklist and the 2 alerts have the correct value in them, however the value is not getting set on country. Is there a different method for setting picklist fields?  var address = res.getReturnValue(); var country = component.find('Country__c'); var pcodeFld = component.find('Postcode__c');  if(country != undefined){  alert(country);  alert(address.Country);  country.set('v.value', address.Country); } if(pcodeFld != undefined){  pcodeFld.set('v.value', address.Postcode); }   EDIT: I can set a default value whilst using $A.createComponents using .set("v.value", "United Kingdom");  it just seems that i can't set it after the component has rendered based on some user action.  Reproduceable Example:  I just can't seem to set the value of any picklist fields when using lightning:inputField.  Component  &lt;aura:component implements="flexipage:availableForRecordHome, force:hasRecordId"&gt; &lt;div class="slds-p-bottom_large slds-p-left_large" style="width:500px"&gt;     &lt;lightning:recordEditForm aura:id="recordViewForm"                                   recordId="{!v.recordId}"                                  objectApiName="Contact"&gt;         &lt;lightning:messages /&gt;         &lt;lightning:inputField fieldName="FirstName" /&gt;         &lt;lightning:inputField fieldName="LastName" aura:id="lastname"/&gt;         &lt;lightning:inputField fieldName="Birthdate" /&gt;         &lt;lightning:inputField fieldName="Phone" /&gt;         &lt;!--Picklist--&gt;         &lt;lightning:inputField fieldName="Country__c" aura:id="Country__c"/&gt;         &lt;lightning:button label="Update" variant="brand" onclick="{!c.update}"/&gt;     &lt;/lightning:recordEditForm&gt; &lt;/div&gt;     &lt;/aura:component&gt;   Controller  ({         update: function(component, event, helper) {         //alert(component.find("Country__c"));        component.find("Country__c").set("v.value", "Ireland");     },  }) My HP Pavilion laptop has Ubuntu 18 version and I once tried to disable InBuilt webcam just for security reasons. But now it wasn't working and I reinstalled newer version of Ubuntu 20. But even after installing newer version the camera is still not working. When I open cheese it shows this screen. I assumed I might have deleted the drivers as I was doing package installation and removel that time. Please suggest me what should I do to get this working. Iridescence In Cycles? Is it possible to create an  shader in Cycles? Specifically for something like , , , etc.. Show that $A$ is an invertible matrix if $\left(A+I\right)^3=0$ and find $A^{-1}$ This post pretty much summarizes my question :   I know for a fact that Mac and Linux are both Unix based  And the commands for Linux should work for Mac, but with limited knowledge for programming I couldn't get it to work.  EDIT: Just saw this -  currently working on it How can I make a list with most used commands in terminal? How to customize Latexian to use other TeX engines or biber? The Mac editor Latexian has built in methods for compiling using latex+dvips, pdflatex and xelatex.  Furthermore, it assumes bibtex and makeindex to deal with bibliographies and indexes, respectively.  How do I customize Latexian to use, e.g. LuaTeX for compiling or Biber for bibliographies? Summation by parts (finite calculus) of $\sum\limits_{i=0}^{n}i\cdot a^i$ I'm studying the calculus of finite differences and have read about summation by parts:  $\sum f(x)\Delta g(x) = f(x)g(x) - \sum g(x+h)\Delta f(x)$.  The tutorials I'm using go a bit woolly at the point of introducing this technique: they use examples where they set $\Delta g(x)$ to $2^x$, and don't really show how to use it for anything a bit harder. I'm at a loss for basic examples.  I wondered if it is possible to determine  $S.n = \sum\limits_{i=0}^{n}i\cdot a^i$  using summation by parts?  If so, how is it done?  Thanks in advance. How to provide a file download from a JSF backing bean? Why does the direction of a dipole moment go from negative to positive charge? An  is defined as $p = q\times d$ (for two point charges $\pm q$ separated by a distance $d$).    What is the physical meaning of this quantity?  Why does the direction of the electric dipole moment go from the negative charge to the positive charge? Another way of saying this, why electric dipole moment is a vector quantity? How to find Oracle's installed version and release from a program? Short story (maybe two in the same collection) about Alien education versus Earth I read this somewhere in the 1990s, but it was probably older. I vaguely remember it as being two stories in sequence in an anthology. One was a story involving an Earth administrator comparing Earth curriculum to Mars curriculum and the second was just a class listing for Martian curriculum.  In the first story, what sticks out in my head was the Earth administrator proudly claiming some high value of WPM for reading for his students and the Martian admitting that their rate was lower, and then added a comment along the lines of that the Martian students, when reading at the rate attained at Earth, could not recall every word of the book and recite them back verbatim. In the curriculum listing, I remember that the physical education classes included Tightrope Walking and Advanced Tightrope Walking. In short, the implication was that Mars held its children, and therefore its citizens, to much higher standards, at the cost of sacrificing actual childhood. The children never played, just studied and drilled.  In retrospect, it might not have been Mars... I know one side was Earth and the other was a planet in the Solar System, and Mars sounds about right, but so does Venus. Either way, it was the casual arrogance of the extra-terrestrial society and the blustering attempts of the Earth administrator that stuck out for me. Replace dynamic content in XML file Where do I place my own .sty or .cls files, to make them available to all my .tex files?