Checking style.width with Javascript IF statement i need to check style.width with an js if statement. But it is not working. How can i do that? My if code: if (document.getElementById(&quot;XXX&quot;).style.width == &quot;100%&quot;) {  }
How do I retrieve an HTML element's actual width and height? Suppose that I have a &lt;div&gt; that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the &lt;div&gt; element.   What should I use? Please include information on browser compatibility.
Non-blocking Synchronous AJAX How to return multiple objects from a Java method? I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so. Where is .bash_profile? I want to put new aliases to my .bash_profile file, but I cannot find this file. Where is it supposed to be? Is the Formula Logically Valid? How to write (La)TeX (with parentheses) [or any other TeX-related logo] Every non-empty subset of the integers which is bounded above has a largest element. apt-get update fails to fetch files, “Temporary failure resolving …” error Err http://archive.canonical.com natty InRelease     Err http://security.ubuntu.com oneiric-security InRelease                Err http://extras.ubuntu.com natty InRelease                             Err http://security.ubuntu.com oneiric-security Release.gpg   Temporary failure resolving ‘security.ubuntu.com’ Err http://archive.canonical.com natty Release.gpg   Temporary failure resolving ‘archive.canonical.com’ Err http://extras.ubuntu.com natty Release.gpg   Temporary failure resolving ‘extras.ubuntu.com’ Err http://gb.archive.ubuntu.com oneiric InRelease Err http://gb.archive.ubuntu.com oneiric-updates InRelease Err http://gb.archive.ubuntu.com natty-backports InRelease Err http://gb.archive.ubuntu.com oneiric Release.gpg   Temporary failure resolving ‘gb.archive.ubuntu.com’ Err http://gb.archive.ubuntu.com oneiric-updates Release.gpg   Temporary failure resolving ‘gb.archive.ubuntu.com’ Err http://gb.archive.ubuntu.com natty-backports Release.gpg   Temporary failure resolving ‘gb.archive.ubuntu.com’  Reading package lists... Done W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric/InRelease       W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric-updates/InRelease   W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/natty-backports/InRelease   W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/InRelease   W: Failed to fetch http://archive.canonical.com/ubuntu/dists/natty/InRelease   W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/InRelease   W: Failed to fetch http://archive.canonical.com/ubuntu/dists/natty/Release.gpg  Temporary failure resolving ‘archive.canonical.com’ W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/Release.gpg  Temporary failure resolving ‘security.ubuntu.com’ W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/natty/Release.gpg  Temporary failure resolving ‘extras.ubuntu.com’ W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’ W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/oneiric-updates/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’ W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/natty-backports/Release.gpg  Temporary failure resolving ‘gb.archive.ubuntu.com’ W: Some index files failed to download. They have been ignored, or old ones used instead.   This is what I'm seeing when I try to run sudo apt-get update. I did an update on my instance yesterday and am now experiencing this. I have a batch file which I use to create an .apk file on my Windows machine. Now I need to be able to create the .apk file in Ubuntu but I don't know how translate my .bat file to a script to be able to run it on Ubuntu.  Below is the batch file which works fine on Windows.  Will you please give me some hints on how I can run it on Ubuntu?  @echo off set PAUSE_ERRORS=0 :user_configuration  :: Path to Flex SDK  set FLEX_SDK=C:\sdk\flex_sdk_4.5.1.21328  :: Path to Android SDK set ANDROID_SDK=C:\sdk\android  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :validation if not exist "%FLEX_SDK%\bin" goto flexsdk if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk goto succeed  :flexsdk echo. echo ERROR: incorrect path to Flex SDK echo. if %PAUSE_ERRORS%==1 pause exit  :androidsdk echo. echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat' echo.  if %PAUSE_ERRORS%==1 pause exit  :succeed set PATH=%PATH%;%FLEX_SDK%\bin set PATH=%PATH%;%ANDROID_SDK%\platform-tools  :: Android packaging set AND_CERT_NAME="PeymanApp" set AND_CERT_PASS=fd set AND_CERT_FILE=cert\SampleApp.p12 set AND_ICONS=icons/android  set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass     %AND_CERT_PASS%  :: Application descriptor set APP_XML=application.xml  :: Files to package set APP_DIR=bin set FILE_OR_DIR=-C %APP_DIR% .  :: Your application ID (must match &lt;id&gt; of Application descriptor) set APP_ID=air.com.doitflash.SampleApp  :: Output packages set DIST_PATH=dist set DIST_NAME=PeymanApp  :validation %SystemRoot%\System32\find /C "&lt;id&gt;%APP_ID%&lt;/id&gt;" "%APP_XML%" &gt; NUL if errorlevel 1 goto badid goto end_validation  :badid echo. echo ERROR: Application ID (APP_ID) does NOT match Application descriptor '%APP_XML%'     (id)  echo.  :end_validation  set TARGET= set PLATFORM=android  ::call bat\Packager.bat if "%PLATFORM%"=="android" goto android-config  :android-config set CERT_FILE=%AND_CERT_FILE% set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS% set ICONS=%AND_ICONS% set DIST_EXT=apk set TYPE=apk goto start  :start if not exist "%CERT_FILE%" goto certificate :: Output file set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" . if not exist "%DIST_PATH%" md "%DIST_PATH%" set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT% :: Package  echo true echo. call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%"     "%APP_XML%" %FILE_OR_DIR% -extdir lib/ echo. if errorlevel 1 goto failed goto end  :certificate echo Certificate not found: %CERT_FILE% echo.  if %PAUSE_ERRORS%==1 pause exit  :failed echo APK setup creation FAILED.  if %PAUSE_ERRORS%==1 pause exit  :end I'm trying to evaluate $(\hat{a}+\hat{a}^\dagger)^k|n\rangle$ Where $\hat{a}$ and $\hat{a}^\dagger$ are ladder operators and $|n\rangle$ the $n$th Fock state. For this, I separated the problem in three parts: $k&lt;n$, $k=n$ and $k&gt;n$. In this part I'm a bit confused: Is it possible to evaluate such operations? Some tips on how to start would be really great. Show a message if directly accessing a deleted answer or comment Currently, if you access a deleted question you will get a short message informing you that the question has been deleted. However, if you click on a direct link to a deleted answer or comment (which you can get via notifications), nothing is displayed.  This is naturally quite confusing as you will get the message about a new answer or comment via notifications, click on the link and simply see nothing.  Therefore, I propose to display some sort of message to the user, informing her/him that the answer or question has been deleted. Note that this is different from always showing a deleted answer/comment, as I specifically request it in case you access the specific URL.  One example for a comment would be:   One example for a deleted answer is:   This question is related to ,  but requests a feature to circumvent the problem altogether. "Agree" vs. "concur" Error installing any module Which version of NFS is my NFS server using? I'm mounting a NFS filesystem on my machine.  How do I figure out what version of the NFS protocol the server uses?  I don't have access to the NFS server machine, but I do have root on my client machine.  Is there anything I can run on my client machine to identify what version of the NFS protocol is being used by the server, or what versions it supports?  I wasn't able to find any useful information in /var/log/messages or kernel debugging output (dmesg).  I have tried running nfsstat, but I'm not sure if it is giving me any useful information.  However, when I run nfsstat -s to request information about the server, I don't see anything useful:  # nfsstat -s Server rpc stats: calls      badcalls   badfmt     badauth    badclnt 0          0          0          0          0          When I run nfsstat -c to request information about the client, I do see some information about Client nfs v3, but I'm not sure how to interpret this.  Does this tell me anything about the protocol being used between my client machine and the NFS server?  Does it mean I am currently using v3 of the NFS protocol?  Does it tell me anything about what versions of the NFS protocol the server supports, e.g., NFS v4? QGIS 2.99 "qgis._core import error: DLL load failed" I am trying to run a standalone application. However, it does not run the program because of mentioned error in title. Here is my code:  from qgis.core import * from qgis.gui import * from qgis.utils import * from PyQt5.QtCore import * from PyQt5.QtGui import *  app = QgsApplication([], True) path = "C:/OSGeo4W64/apps/qgis-dev" app.setPrefixPath(path, True) app.initQgis()  canvas = QgsMapCanvas() title = "PyQGIS Standalone Application Example" canvas.setWindowTitle(title) canvas.setCanvasColor(Qt.white)  layer_info = 'LineString?crs=epsg:4326' layer = QgsVectorLayer(layer_info, 'MyLine', "memory") pr = layer.dataProvider() linstr = QgsFeature() wkt = "LINESTRING (1 1, 10 15, 40 35)" geom = QgsGeometry.fromWkt(wkt) linstr.setGeometry(geom) pr.addFeatures([linstr]) layer.updateExtents() QgsProject.instance().addMapLayer(layer)  canvas.setExtent(layer.extent()) canvas.setLayers([layer]) canvas.zoomToFullExtent() exitcode = app.exec_() QgsApplication.exitQgis() sys.exit(exitcode)   When I run it, I get this error:  Traceback (most recent call last):   File "C:/Users/DELL/Desktop/MyMap/myMap.py", line 1, in &lt;module&gt;     from qgis.core import *   File "C:\OSGeo4W64\apps\qgis-dev\python\qgis\__init__.py", line 72, in &lt;module&gt;     from qgis.core import QgsFeature, QgsGeometry   File "C:\OSGeo4W64\apps\qgis-dev\python\qgis\core\__init__.py", line 34, in &lt;module&gt;     from qgis._core import *   ImportError: DLL load failed: The specified module could not be found.  Python version is: 3.6 PyQt   version is: PyQt5.9 Windows 10 - 64bit  I also add many path:  %SystemRoot%\system32 %SystemRoot% %SystemRoot%\System32\Wbem %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ C:\OSGeo4W64 C:\OSGeo4W64\apps C:\OSGeo4W64\apps\gdal-dev C:\OSGeo4W64\apps\gdal-dev\bin C:\OSGeo4W64\apps\gdal-dev\pymod3\Lib\site-packages C:\OSGeo4W64\apps\grass\grass-7.2.2\bin C:\OSGeo4W64\apps\Python36 C:\OSGeo4W64\apps\Python36\Scripts C:\OSGeo4W64\apps\Python36\DLLs C:\OSGeo4W64\apps\Python36\lib\site-packages C:\OSGeo4W64\apps\qgis-dev C:\OSGeo4W64\apps\qgis-dev\bin C:\OSGeo4W64\apps\qgis-dev\lib C:\OSGeo4W64\apps\qgis-dev\python C:\OSGeo4W64\apps\qgis-dev\python\qgis C:\OSGeo4W64\apps\Qt5 C:\OSGeo4W64\apps\Qt5\lib C:\OSGeo4W64\bin C:\OSGeo4W64\apps\qgis-dev\python C:\OSGeo4W64\apps\Python36\lib C:\OSGeo4W64\include C:\Users\Mustafa Uçar\AppData\Roaming\QGIS\QGIS3\profiles\default C:\Users\Mustafa Uçar\AppData\Roaming\QGIS\QGIS3\profiles\default\QGIS   How can I fix this error? I understand that the letter "J" is relatively new — perhaps 400–500 years old.  But since there has long been important names that begin with J, such as Jesus, Joshua, Justinian, etc., and which predate the introduction of a special letter, does that mean that the "J" sound predated the letter, or were such famous names spelled and pronounced differently? jQuery animate() I use babelbib and I have a source with two authors. Contrarily to when using the plain bib style, as soon as I switch to babplain, the author names are formatted like this:  [1] Müller, Jan und Eva Schulze: Name of the book, 2015.   While I would like both author names to be formatted the same way, that is one of these:  [1] Müller, Jan und Schulze, Eva: Name of the book, 2015. [1] Jan Müller und Eva Schulze: Name of the book, 2015.   sources:  % test.tex \usepackage[ngerman]{babel} \usepackage[fixlanguage]{babelbib} \selectbiblanguage{ngerman} \bibliographystyle{babplain} \bibliography{test}  % test.bib @manual{foo,     author = "Müller, Jan and Schulze, Eva",     title = "Name of the book",     year = "2015", }   I can fix it by specifying and {Schulze, Eva}, but that way all is treated as the last name, that cannot be the solution, can it? How to connect Nokia Lumia 730 to Ubuntu 15.04? My Nokia Lumia 730 (WP8.1) is not getting detected on Ubuntu 15.04.  Can anybody tell me how to fix this? What is the connection between regularization and the method of lagrange multipliers ? To prevent overfitting people people add a regularization term (proportional to the squared sum of the parameters of the model) with a regularization parameter $\lambda$ to the cost function of linear regression. Is this parameter $\lambda$ the same as a lagrange multiplier? So is regularization the same as the method of lagrange multiplier? Or how are these methods connected? Does anybody know how to move the keyboard caret in a textbox to a particular position?  For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position the caret before character 20, how would I go about it?  This is in differentiation from this question:  , which requires jQuery.