Posts

Showing posts from July, 2018

Apache Error "Could Not Reliably Determine The Server's Fully Qualified Domain Name"

Answer : 6# 13.04 and older This is just a friendly warning and not really a problem (as in that something does not work). If you go to: /etc/apache2/apache2.conf and insert: ServerName localhost and then restart apache by typing into the terminal: sudo systemctl reload apache2 the notice will disappear. If you have a name inside /etc/hostname you can also use that name instead of localhost . And it uses 127.0.1.1 if it is inside your /etc/hosts : 127.0.0.1 localhost 127.0.1.1 myhostname Preferred method Troubleshooting Apache If you get this error: apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName then use a text editor such as "sudo nano" at the command line or "gksudo gedit" on the desktop to create a new file, sudo nano /etc/apache2/conf.d/fqdn or gksu "gedit /etc/apache2/conf.d/fqdn" then add ServerName localhost to the file and save. Thi

Assembly: Why Some X86 Opcodes Are Invalid In X64?

Answer : The 06 and 07 opcodes in 32-bit mode are the instructions PUSH ES and POP ES . In 64-bit mode, the segment registers CS, DS, ES, and SS are no longer used to determine memory addresses: the processor assumes a base address of 0 and no size limits. As there's now usually no reason for applications (other than the operating system itself) to access these registers, the push/pop opcodes for changing and accessing them were removed, leaving only mov to/from Sreg (which is just 2 total opcodes; the register number goes in the ModRM byte instead of part of the 1-byte opcode). That's totally sufficient for something that's almost never needed. The FS and GS segment registers can still set the base address in 64-bit mode, so push and pop opcodes related to them have not been removed. (These 2-byte 0F xx opcodes were added in 386, and are a less valuable part of opcode space than the old 1-byte opcodes for 8086 segment registers). Push/pop or mov of segment reg

APScheduler(Advance Python Scheduler) ImportError: No Module Named Scheduler

Answer : I got same issue, but then I found, I had installed apscheduler version 3 then I shifted to version 2.1.2 using, pip uninstall apscheduler pip install apscheduler==2.1.2 Just checkout before switching to version 2.1.2, If you wanted to use extra features added in version 3. In my case I didn't wanted much. Your import is wrong. It should be: from apscheduler.schedulers.blocking import BlockingScheduler Reference example here: """ Demonstrates how to use the blocking scheduler to schedule a job that executes on 3 second intervals. """ from datetime import datetime import os from apscheduler.schedulers.blocking import BlockingScheduler def tick(): print('Tick! The time is: %s' % datetime.now()) if __name__ == '__main__': scheduler = BlockingScheduler() scheduler.add_job(tick, 'interval', seconds=3) print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt

Chrome Idm Integration Module Code Example

Example: idm chrome extension Copy the url below and paste to your Broswer Click on the button "Add to Chrome" https://chrome.google.com/webstore/detail/idm-integration-module/ngpampappnmepgilojfohadhhmbhlaek/related

Check Numpy Version With Pip Code Example

Example: check numpy version import numpy print(numpy.version.version)

Add Custom View To The Right Of Toolbar

Answer : I just set layout_gravity to the right and it worked <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="0dp" android:layout_height="?android:actionBarSize" app:title="NEW REQUESTS" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="blahblah" android:layout_gravity="right" /> </android.support.v7.widget.Toolbar> You can add ViewGroups inside Toolbar <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

Chrome Urls List Code Example

Example: chrome urls list chrome://chrome-urls/

Cdn Font Awesome Icons Code Example

Example 1: fontawesome cdn < link href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel = "stylesheet" > Example 2: font awesome icons cdn To load all styles : < link rel = "stylesheet" href = "https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity = "sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin = "anonymous" / > Example 3: fontawesome cdn < link rel = "stylesheet" href = "https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity = "sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin = "anonymous" / > Example 4: font awesome cdn < script src = "https://kit.fontawesome.com/a9545f17e8.js" crossorigin = "anonymous" > < / script > Example 5: font awesome cdn < link rel = "stylesheet&q

Change SVG Size In Angular Material 2 Using Vanilla CSS Or HTML

Answer : It seems that library styles override your css inline declaration. Try maybe to add !important declaration to your style: style="font-size: 16 !important" or since you didn't provide more code, try to inspect this icon node, to check which style define the font-size. Also check here UPDATE : Here is another possibly working solution. Add transform: scale(2); style for svg element you want to resize, where 2 is 200% of actual size (of course you can also downsize them using for example 0.5 value for 50%). Here is working sample for the website with your icons and link to documnetation: .size-24 button svg { width: 24px; height: 24px; transform: scale(2); } I played with this for way too long. I have a series of icons that I want to be scaled to fit in various mat-icon sizes, but each icon needs a different scale so they appear balanced with the other icons - effectively increasing the size of the viewBox. In the end this worked well

Apache Could Not Be Started - ServerRoot Must Be A Valid Directory And Unable To Find The Specified Module

Answer : Just run setup_xampp.bat from shell (shell from XAMPP control panel)and the paths should be set automatically for the portable version of XAMPP for windows. It has worked for me. navigate to httpd.conf file in conf direcotry in Apache24 or whatever apache file you have. Go to ServerRoot= ".." line and change the value to the path where apache is located like "C:\Program Files\Apache24" If you open an editor and jump to the exact line shown in the error message (within the file httpd.conf ), this is what you'd see: #LoadModule access_compat_module modules/mod_access_compat.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule auth_form_module modules/mod_auth_form.so The paths t

Memset Was Not Declared In This Scope Code Example

Example: error: ‘memset’ was not declared in this scope in cpp C : #include < string . h > C ++ : #include < cstring > NOTE : inclusion of above headers works fine

Bootstrap Success Message Popup Example

Example 1: boootstrap alerts < div class = "alert alert-primary" role = "alert" > This is a primary alert—check it out ! < / div > < div class = "alert alert-secondary" role = "alert" > This is a secondary alert—check it out ! < / div > < div class = "alert alert-success" role = "alert" > This is a success alert—check it out ! < / div > < div class = "alert alert-danger" role = "alert" > This is a danger alert—check it out ! < / div > < div class = "alert alert-warning" role = "alert" > This is a warning alert—check it out ! < / div > < div class = "alert alert-info" role = "alert" > This is a info alert—check it out ! < / div > < div class = "alert alert-light" role = "alert" > This is a light alert—check it out !

Android: How Do You Check If A Particular AccessibilityService Is Enabled

Answer : I worked this one out myself in the end: public boolean isAccessibilityEnabled() { int accessibilityEnabled = 0; final String LIGHTFLOW_ACCESSIBILITY_SERVICE = "com.example.test/com.example.text.ccessibilityService"; boolean accessibilityFound = false; try { accessibilityEnabled = Settings.Secure.getInt(this.getContentResolver(),android.provider.Settings.Secure.ACCESSIBILITY_ENABLED); Log.d(LOGTAG, "ACCESSIBILITY: " + accessibilityEnabled); } catch (SettingNotFoundException e) { Log.d(LOGTAG, "Error finding setting, default accessibility to not found: " + e.getMessage()); } TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':'); if (accessibilityEnabled==1) { Log.d(LOGTAG, "***ACCESSIBILIY IS ENABLED***: "); String settingValue = Settings.Secure.getString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILIT

Can You Catch All Errors Of A React.js App With A Try/catch Block?

Answer : React 16 introduced Error Boundaries and the componentDidCatch lifecycle method: class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false }; } componentDidCatch(error, info) { // Display fallback UI this.setState({ hasError: true }); // You can also log the error to an error reporting service logErrorToMyService(error, info); } render() { if (this.state.hasError) { // You can render any custom fallback UI return <h1>Something went wrong.</h1>; } return this.props.children; } } Then you can use it as a regular component: <ErrorBoundary> <MyWidget /> </ErrorBoundary> Or you can wrap your root component with the npm package react-error-boundary, and set a fallback component and behavior. import {ErrorBoundary} from 'react-error-boundary'; const myErrorHandler = (error: Error, componentStack: string) => { //

C++ Program To Find Gcd Of 3 Numbers Code Example

Example: c++ program to find gcd of 3 numbers #include<stdio.h> int main ( ) { int a , b , c , hcf , st ; printf ( "Enter three numbers : " ) ; scanf ( "%d,%d,%d" , & a , & b , & c ) ; st = a < b? ( a < c?a : c ) : ( b < c?b : c ) ; for ( hcf = st ; hcf >= 1 ; hcf - - ) { if ( a % hcf == 0 & & b % hcf == 0 & & c % hcf == 0 ) break ; } printf ( "%d" , hcf ) ; return 0 ; }