Posts

Click Keys Ahk Code Example

Example: autohotkey hotkeys #^!s:: ;This occurs when pressed Windows Button+Control+Alt+s Send Sincerely,{enter}John Smith ; This line sends keystrokes to the active (foremost) window. return

Centos 7 Save Iptables Settings

Answer : Solution 1: Disable firewalld by the following command: systemctl disable firewalld Then install iptables-service by following command: yum install iptables-services Then enable iptables as services: systemctl enable iptables Now you can save your iptable rules by following command: service iptables save Solution 2: CentOS 7 is using FirewallD now! Use the --permanent flag to save settings. Example: firewall-cmd --zone=public --add-port=3000/tcp --permanent Then reload rules: firewall-cmd --reload Solution 3: On CentOS 7 Minimal you may need to install the iptables-services package (thanks to @RichieACC for the suggestion): sudo yum install -y iptables-services And then enable the service using systemd : sudo systemctl enable iptables.service And run the initscript to save your firewall rules: sudo /usr/libexec/iptables/iptables.init save Solution 4: iptables-save > /etc/sysconfig/iptables will save the current configuration wi...

Wait System Call C Code Example

Example: wait function in c sleep ( /*How many seconds do you want to wait*/ ) ;

ChromeDriver - Disable Developer Mode Extensions Pop Up On Selenium WebDriver Automation

Answer : Did you try disabling the developer extensions with command line param? Try with the following Selenium WebDriver java code: System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-extensions"); driver = new ChromeDriver(options); I cannot disable extensions because I'm developing & testing one. What I'm doing to dismiss this popup is the following: I load chrome with my extension using Selenium. I then immediately create a new window (via the SendKeys(Control-N) method). This predictably brings up the "Disable Developer Mode Extensions" popup after 3 seconds in the new window. I can't tell programmatically when it pops up (doesn't show in screenshots) so instead I simply wait 4 seconds. Then I close the tab via driver.Close(); (which also closes this new window). Chrome takes that as "cancel", dis...

Avatar Last Airbender OC SI Code Example

Example 1: avatar the last airbender The best tv show! Example 2: avatar: the last airbender wait he deleted his reply he said "best show ever"

Addclassname Code Example

Example: javascript add class to element var someElement = document . getElementById ( "myElement" ) ; someElement . className += " newclass" ; //add "newclass" to element (space in front is important)

Check Value In Array Exists Flutter Dart

Answer : list.contains(x); Contains method Above are the correct answers to the current question. But if someone like me is here to check value inside List of Class object then here is the answer. class DownloadedFile { String Url; String location; } List of DownloadedFile List<DownloadedFile> listOfDownloadedFile = List(); listOfDownloadedFile.add(...); Now check if a specific value is inside this list var contain = listOfDownloadedFile.where((element) => element.Url == "your URL link"); if (contain.isEmpty) //value not exists else //value exists There maybe better way/approach. If someone know, then let me know. :) List<int> values = [1, 2, 3, 4]; values.contains(1); // true values.contains(99); // false Method - Contains of Iterable does exactly what you need. See the example above.

Python Create Directory Code Example

Example 1: python create directory # This requires Python’s OS module import os # 'mkdir' creates a directory in current directory . os . mkdir ( 'tempDir' ) # can also be used with a path , if the other folders exist . os . mkdir ( 'tempDir2/temp2/temp' ) # 'makedirs' creates a directory with it's path , if applicable . os . makedirs ( 'tempDir2/temp2/temp' ) Example 2: create a directory python # creates a directory without throwing an error import os def create_dir ( dir ) : if not os . path . exists ( dir ) : os . makedirs ( dir ) print ( "Created Directory : " , dir ) else : print ( "Directory already existed : " , dir ) return dir Example 3: create folder python import os # define the name of the directory to be created path = "/tmp/year" try : os . mkdir ( path ) except OSError : print ( "Creation of the directory %s failed...

Center Style Code Example

Example 1: css center text /* To center text, you need to use text-align. */ .centerText { text-align: center; /* This puts the text into the center of the screen. */ } /* There are also other things that you can use in text-align: left, right, and justify. Left and right make the test align to the right or left of the screen, while justify makes the text align both sides by spreading out spaces between some words and squishing others. */ Example 2: css text align center body { text-align: center; }

Appdata/Local/Packages- Safe To Remove?

Answer : AppData folders store per-user information for applications, so if you delete an applications data, it will have to recreate it from default values. In effect the program will forget that you have used it before, configuration choices you may have made, saved files (like game savefiles), etc. I would recommend you use a tool like windirstat to determine where the space is being used, and what application(s) rely on it. From there you can then begin to determine the impact of your proposed deletion. See here for some more information related to your query: http://www.pcworld.com/article/2690709/windows/whats-in-the-hidden-windows-appdata-folder-and-how-to-find-it-if-you-need-it.html If you use Windows Subsystem for Linux (WSL) you will blow away your entire file system for any linux distribution used if you delete this folder. At a quick glance that specific folder appears to be the location where the "per user" settings and state information for the Windows...

Android Min SDK Version Vs. Target SDK Version

Answer : The comment posted by the OP to the question (basically stating that the targetSDK doesn't affect the compiling of an app) is entirely wrong! Sorry to be blunt. In short, here is the purpose to declaring a different targetSDK from the minSDK: It means you are using features from a higher level SDK than your minimum, but you have ensured backwards compatibility . In other words, imagine that you want to use a feature that was only recently introduced, but that isn't critical to your application. You would then set the targetSDK to the version where this new feature was introduced and the minimum to something lower so that everyone could still use your app. To give an example, let's say you're writing an app that makes extensive use of gesture detection. However, every command that can be recognised by a gesture can also be done by a button or from the menu. In this case, gestures are a 'cool extra' but aren't required. Therefore you would set ...

Bash: Bad Substitution

Answer : The default shell ( /bin/sh ) under Ubuntu points to dash , not bash . me@pc:~$ readlink -f $(which sh) /bin/dash So if you chmod +x your_script_file.sh and then run it with ./your_script_file.sh , or if you run it with bash your_script_file.sh , it should work fine. Running it with sh your_script_file.sh will not work because the hashbang line will be ignored and the script will be interpreted by dash , which does not support that string substitution syntax. I had the same problem. Make sure your script didnt have #!/bin/sh at the top of your script. Instead, you should add #!/bin/bash For others that arrive here, this exact message will also appear when using the env variable syntax for commands, for example ${which sh} instead of the correct $(which sh)

Android Microsoft Office Library (.doc, .docx, .xls, .ppt, Etc.)

Answer : Since most of the documents we need to display are already hosted on the web, we opted to use an embedded web view that opens the document using google docs viewer. We still have a few locally stored documents though that this approach doesn't work with. For these, our solution was to rely on the support of existing apps. After spending some more time with Android, It seems that most devices come equipped with some sort of document/pdf reading capability installed fresh out of the box. In the event that they don't have a capable app, we direct them to a market search for a free reader. Unfortunately there's no built in Android control to edit MS Office files, or even to display them! It's a pretty big omission given iOS has built in support for displaying Office files. There don't seem to be viewer app consistently enough available to rely on (and they may not provide the kind of user experience you're hoping for either). If you want to disp...

Bind Jump Scroll Csgo Code Example

Example: csgo mouse wheel jump bind bind mwheelup + jump ; bind mwheeldown + jump ; bind space + jump

AlamoFire Download In Background Session

Image
Answer : Update Based on this amazing tutorial, I have put together an example project available on GitHub. It has an example for background session management. According to Apple's URL Loading System Programming Guide: In both iOS and OS X, when the user relaunches your app, your app should immediately create background configuration objects with the same identifiers as any sessions that had outstanding tasks when your app was last running, then create a session for each of those configuration objects. These new sessions are similarly automatically reassociated with ongoing background activity. So apparently by using the appropriate background session configuration instances, your downloads will never be "in flux". I have also found this answer really helpful. Original answer From Alamofire's GitHub page: Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default ses...

Cant Uninstall Eslint Code Example

Example: npm uninstall eslint npm uninstall < module_name >