Posts

Showing posts from June, 2000

Shortcut Key For Shutdown Lenovo Ideapad 330 Code Example

Example: shortcut to rename the file on lenovo s340 If the default meaning is Volume Up you have to press Fn and then the F2 / Volumne Up key .

Append Prepend Jquery Code Example

Example 1: append before jquery $ ( "h2" ) . insertBefore ( $ ( ".container" ) ) ; Example 2: prepend element jquery $ ( ".inner" ) . prepend ( "<p>Test</p>" ) ; Example 3: jquery append $ ( "p" ) . append ( " <b>Appended text</b>." ) ; Example 4: jquery append before Consider the following HTML : Html : -- -- -- -- -- -- -- - < h2 > Greetings < / h2 > < div class = "container" > < div class = "inner" > Hello < / div > < div class = "inner" > Goodbye < / div > < / div > You can create content and insert it into several elements at once : jquery : -- -- -- -- -- -- -- $ ( ".inner" ) . prepend ( "<p>Test</p>" ) ; Each < div class = "inner" > element gets this new content : Html Result : < h2 > Greetings < / h2 > <

C# Bool Function Code Example

Example: bool in c# bool isCSharpFun = true ; bool isFishTasty = false ; Console . WriteLine ( isCSharpFun ) ; // Outputs True Console . WriteLine ( isFishTasty ) ; // Outputs False

AutoHotKey Gui Button Code Example

Example: gui button ahk Gui, Add, Button gLayer1 w80, Button ;The "g" command in a button (in this case gLayer1) is a goto command. If you press the button, it goes to layer1 Gui, Show ;Shows the gui Layer1: ;The layer that becomes active when you press the button MsgBox, You pressed the button ;A simple Messagebox

Check Email Valid Js Code Example

Example 1: javascript regex email function validateEmail ( emailAdress ) { let regexEmail = / ^ \w + ( [ \. - ] ? \w + ) * @ \w + ( [ \. - ] ? \w + ) * ( \. \w {2,3} ) + $ / ; if ( emailAdress . match ( regexEmail ) ) { return true ; } else { return false ; } } let emailAdress = "test@gmail.com" ; console . log ( validateEmail ( emailAdress ) ) ; Example 2: form validation for email in js < script > function validateform ( ) { var name = document . myform . name . value ; var password = document . myform . password . value ; if ( name == null || name == "" ) { alert ( "Name can't be blank" ) ; return false ; } else if ( password . length < 6 ) { alert ( "Password must be at least 6 characters long." ) ; return false ; } }

Can We Use Keyboard & Mouse On PS3?

Answer : Yes. To add a Bluetooth keyboard, go to Settings > Accessories > Manage Bluetooth Devices. For a non-Bluetooth wireless keyboard to work, it would probably have to have its own wireless receiver that would plug into the console via USB. It also supports USB keyboards. From page 31 of my PS3 owner's manual: Using a USB keyboard You can enter characters using a USB keyboard (sold separately). While the text entry screen is displayed, if any key on the connected USB keyboard is pressed, the text entry screen will enable you to use the USB keyboard. Hint You cannot use the predictive mode when using a USB keyboard. Unfortunately, it looks like there aren't many games that natively support keyboard/mouse. I did find the Eagle Eye, a third-party adapter that allows you to use a USB keyboard/mouse in lieu of a controller regardless of whether or not the games supports it. Although you can use a mouse and keyboard, you can't play

Change Package Name Of Android Studio Project Code Example

Example: android studio change package name In Android Studio, you can do this: For example, if you want to change com.example.app to my.awesome.game, then: In your Project pane, click on the little gear icon ( Gears icon ) Uncheck the Compact Empty Middle Packages option Compact Empty Middle Packages Your package directory will now be broken up into individual directories Individually select each directory you want to rename, and: Right-click it Select Refactor Click on Rename In the pop-up dialog, click on Rename Package instead of Rename Directory Enter the new name and hit Refactor Click Do Refactor in the bottom Allow a minute to let Android Studio update all changes Note: When renaming com in Android Studio, it might give a warning. In such case, select Rename All Enter image description here Now open your Gradle Build File (build.gradle - Usually app or mobile). Update the applicationId in the defaultConfig to your new Package Name and Sync Gradle, if it hasn&

Angular RouterOutlet Example

directive Acts as a placeholder that Angular dynamically fills based on the current router state. See more... See also Routing tutorial. RouterLink Route Exported from RouterModule Selectors router-outlet Properties Property Description @ Output('activate') activateEvents : EventEmitter<any> @ Output('deactivate') deactivateEvents : EventEmitter<any> isActivated : boolean Read-Only component : Object Read-Only activatedRoute : ActivatedRoute Read-Only activatedRouteData : Data Read-Only Template variable references Identifier Usage outlet #myTemplateVar="outlet" Description Each outlet can have a unique name, determined by the optional name attribute. The name cannot be set or changed dynamically. If not set, default value is "primary". <router-outlet></router-outlet> <router-outlet name='left'></router

Can't Debug Current Typescript File In VS Code Because Corresponding JavaScript Cannot Be Found

Answer : The problem may be with your map files and not with configuration. Before trying anything else you want to make sure your paths that you are using in your launch configuration are correct. You can do so by substituting the paths with absolute paths on your system temporarily to see if it works. If it does not work you should: Check your tsconfig and make sure mapRoot under compilerOptions is not set to anything. This is what official documentation has to say about it: Specifies the location where debugger should locate map files instead of generated locations. Use this flag if the .map files will be located at run-time in a different location than the .js files. The location specified will be embedded in the sourceMap to direct the debugger where the map files will be located. You can read more about it here In most of the cases, you don't really want to set it to anything. Also, make sure that "sourceMap" : true` is set in co

Android Get Current Timestamp?

Answer : The solution is : Long tsLong = System.currentTimeMillis()/1000; String ts = tsLong.toString(); From developers blog: System.currentTimeMillis() is the standard "wall" clock (time and date) expressing milliseconds since the epoch. The wall clock can be set by the user or the phone network (see setCurrentTimeMillis(long)), so the time may jump backwards or forwards unpredictably. This clock should only be used when correspondence with real-world dates and times is important, such as in a calendar or alarm clock application. Interval or elapsed time measurements should use a different clock. If you are using System.currentTimeMillis() , consider listening to the ACTION_TIME_TICK , ACTION_TIME_CHANGED and ACTION_TIMEZONE_CHANGED Intent broadcasts to find out when the time changes. 1320917972 is Unix timestamp using number of seconds since 00:00:00 UTC on January 1, 1970. You can use TimeUnit class for unit conversion - from System.currentTimeMillis() to s

Can I Play Terraria On A Mac?

Answer : An enterprising user on the Terraria forums created a wrapper for Terraria using MonoGame called MacTerraria. To use it: Download Steam and purchase Terraria. You can do this on a Mac. Download Terraria using Steam. This can't be done on a Mac, unfortunately: you need to use Boot Camp, a virtual machine, or another Windows PC to download it. Copy the terraria folder found in: C:\Program Files (x86)\steamapps\common to your Mac. Download MacTerraria from the linked forum post and place it anywhere you want (probably good to keep it in your Applications folder). Locate Terraria.exe. This will be in Steam's application support folder. You can get to do the default location by going to the Go menu in Finder, selecting Go to Folder... , typing in the following and pressing the Go button: ~/Library/Application Support/Steam/SteamApps/common/terraria Copy Terraria.exe and place it in the folder alias MacTerraria came with. If you don't have t

156 In Binary Number Code Example

Example: how to make a binary number inaudrino byte binary_number = 0b00000000;

Aws Cli Install Manjaro Code Example

Example: aws cli install # AWS CLI V2 # Installing on linux # depends on glibc, groff, and less curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install

Capture Image From Camera And Display In Activity

Answer : Here's an example activity that will launch the camera app and then retrieve the image and display it. package edu.gvsu.cis.masl.camerademo; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class MyCameraActivity extends Activity { private static final int CAMERA_REQUEST = 1888; private ImageView imageView; private static final int MY_CAMERA_PERMISSION_CODE = 100; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.imageView = (ImageView)this.findViewById(R.id.imageView1); Button photoButton = (Button) this.findViewById(R.id.button1); photoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v

Print Name In C Code Example

Example 1: print variable c printf ( "%d\n" , x ) ; Example 2: print name of file argv c int main ( int argc , char * argv [ ] ) { int i ; for ( i = 0 ; i < argc ; ++ i ) { printf ( "%s\n" , argv [ i ] ) ; } }