Posts

Showing posts from March, 2002

Pinmode Arduino Meaning Code Example

Example 1: arduino pinmode void setup ( ) { pinMode ( 13 , OUTPUT ) ; // sets the digital pin 13 as output } void loop ( ) { digitalWrite ( 13 , HIGH ) ; // sets the digital pin 13 on delay ( 1000 ) ; // waits for a second digitalWrite ( 13 , LOW ) ; // sets the digital pin 13 off delay ( 1000 ) ; // waits for a second } Example 2: arduino pinMode pinMode ( Pin_number , State ) ; ex : pinMode ( 2 , HIGH ) ;

Online Gdb Compiler C+ Code Example

Example 1: c++ online compiler This two are good C ++ compilers : https : //www.onlinegdb.com/online_c++_compiler https : //www.programiz.com/cpp-programming/online-compiler/ Example 2: cpp online compiler Best Site With auto compile : https : //godbolt.org/z/nEo4j7

Create Folder If It Does Not Exist In The Google Drive

Answer : Files.List request = service.files().list().setQ( "mimeType='application/vnd.google-apps.folder' and trashed=false"); FileList files = request.execute(); You could now go through all folders in "files" and check if any of the folders have the searched title. Don't forget to loop through all pages with: request.setPageToken(files.getNextPageToken()); Edit: Maybe you could have a look at this site. You can add the title in your search criteria instead so you do not have to retrieve all the folders.

Console.WriteLine("Hello World!") Code Example

Example 1: hello world program in c# // Hello World! program namespace HelloWorld { class Hello { static void Main ( string [ ] args ) { System . Console . WriteLine ( "Hello World!" ) ; } } } Example 2: hello world c# Console . WriteLine ( "Hello World!" ) ;

1 Million Pound In Indian Rupees Code Example

Example: 1 pound in rupees x lies from 121 < X >1331, x^2+1 when divided by 11 what will not be the remainder?

Could Not Get GOOGLE_APP_ID In Google Services File From Build Environment

Image
Answer : This worked for me: When install Crashlytic with Firebase, for multiple scheme, you can have error Could not get GOOGLE_APP_ID in Google Services file from build environment . You can fix it by: In Build Settings , add a user define for file name in User Defined : In Build Phases , tap plus button, New Run Script Phase above your Crashlytic build phase, and type this code to the text field. Remember to rename %YOUR_CUSTOM_PATH_TO_FOLDER% to your path to Plist files: GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/%YOUR_CUSTOM_PATH_TO_FOLDER%/${FIREBASE_CONFIG_FILE}.plist" BUILD_APP_DIR="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}" GOOGLE_SERVICE_INFO_PLIST_TO="${BUILD_APP_DIR}/GoogleService-Info.plist" cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}" I had this in my "Build Phases" and it's works "${PODS_ROOT}/FirebaseCrashlytics/run" "${PODS_ROOT}/FirebaseCrashlytics/uploa

Android - Programmatically Change The State Of A Switch Without Triggering OnCheckChanged Listener

Answer : Set the listener to null before calling setCheck() function, and enable it after that, such as the following: switch.setOnCheckedChangeListener (null); switch.setChecked(true); switch.setOnCheckedChangeListener (this); Reference : Change Checkbox value without triggering onCheckChanged Well, just before doing things in code with the switch you could just unregister the Listener, then do whatever you need to, and again register the listener. Every CompoundButton (two states button - on/off) has a pressed state which is true only when a user is pressing the view . Just add a check in your listener before starting the actual logic: if(compoundButton.isPressed()) { // continue with your listener } That way, changing the checked value programmatically won't trigger the unwanted code. From @krisDrOid answer.

Strncat Function In C Code Example

Example: strncat c # include <stdio.h> # include <string.h> int main ( ) { char src [ 50 ] , dest [ 50 ] ; strcpy ( src , "This is source" ) ; strcpy ( dest , "This is destination" ) ; strncat ( dest , src , 15 ) ; printf ( "Final destination string : |%s|" , dest ) ; return ( 0 ) ; } output : Final destination string : | This is destinationThis is source |

Angular 2 / Leaflet Map, How To Link To A Component From Marker Popup ? ... RouterLink?

Answer : There is a very simple approach and a very complex one. The simple approach is to use raw HTML with anchor element outside of angular without RouterLink . Register to clicks on that anchor element and use the Router service to navigate. The task was to fire links but the actual problem is far deeper, now it links next time its showing an angular component... So, for the complex solution: This is an highly advanced topic... Not only it involves using advanced angular techniques it's also advanced in the leaflet implementation. I'll do my best to convey the message but due to the complexity the examples will be very simple and will require work. First - Angular realm. An HTML string that contains directives, components or pipes will never work, the only way is to initialize a View Let's define A View as a reference to view instance of a component or a template . These are called ComponentRef and TemplateRef So, we have 2 ways to solve this

Javascript Dialog Box Confirm Code Example

Example 1: jquery confirmation dialog example $ ( " #complexConfirm " ) .confirm ( { title:"Delete confirmation" , text:"This is very dangerous , you shouldn't do it! Are you really really sure?" , confirm: function ( button ) { alert ( "You just confirmed." ) ; } , cancel: function ( button ) { alert ( "You aborted the operation." ) ; } , confirmButton : "Yes I am" , cancelButton : "No" } ) ; Example 2: javascript alert alert ( varible ) ;

Display Flex Css Tricks Code Example

Example: flex box css tricks .container { flex-direction : row | row-reverse | column | column-reverse ; }

A Man Rows A Boat At A Speed Of 5km/hr In Still Water Code Example

Example: A boat covers a certain distance downstream in 1 hour, while it comes back in 1 hour 40 min. If the speed of the stream be 5 kmph, what is the speed of the boat in still water? A boat covers a certain distance downstream in 1 hour, while it comes back in 1 hour 40 min. If the speed of the stream be 5 kmph, what is the speed of the boat in still water?

Googleapis Fonts Code Example

Example 1: add google font CSS @import url ( https://fonts.googleapis.com/css?family=Roboto ) ; HTML <link rel="stylesheet" href="https://fonts .googleapis .com /css?family=Roboto"/ > body { font-family : "Roboto" ; } Example 2: use google fonts in css @import url ( 'https://fonts.googleapis.com/css?family=Open+Sans&display=swap' ) ; Example 3: google fonts css Check out the font names and change 'finger paint' to another font name to how different google font appears on webpage. <!DOCTYPE html > <html > <head > <link href='https://fonts .googleapis .com /css?family=Finger Paint' rel='stylesheet' > <style > body { font-family : 'Finger Paint' ; font-size : 22 px ; } </style> </head> <body> <h1>Finger Paint</h1> <p>Lorem ipsum dolor sit amet , consectetuer adipiscing elit.</p> <p> 123456790 </p> <p>ABCDE

How To Select Multiple Classes In Css Code Example

Example 1: css multiple classes //HTML Code <div class = 'firstClass secondClass' > </div > //CSS Code .firstClass .secondClass { } Example 2: css change multiple classes .objectOne , .objectTwo { /* We will now both be changed */ margin : 0 auto ; } Example 3: css multiple classes <div class= "a-class another-class" ></div>

Android - ImageView With Rounded Only One Corner

Image
Answer : You can use the Material Components Library. With the version 1.2.0-alpha03 there is the new ShapeableImageView . Just use in your layout: <com.google.android.material.imageview.ShapeableImageView app:srcCompat="@drawable/..." ../> And in your code apply the ShapeAppearanceModel with: float radius = getResources().getDimension(R.dimen.default_corner_radius); imageView.setShapeAppearanceModel(imageView.getShapeAppearanceModel() .toBuilder() .setTopRightCorner(CornerFamily.ROUNDED,radius) .setBottomLeftCorner(CornerFamily.ROUNDED,radius) .build()); You can use this library and put your ImageView inside the Layout https://github.com/JcMinarro/RoundKornerLayouts and can set the radius for specific corners like this containerLayout.setCornerRadius(2f, CornerType.ALL); containerLayout.setCornerRadius(2f, CornerType.BOTTOM_LEFT); Other choices public final enum class CornerType private constructor() : kotli

Small Text In Bootstrap 4 Code Example

Example 1: bootstrap 4 font bold font-weight-bold Example 2: bootstrap text size <p class= "h1" >h1. Bootstrap heading</p> <p class= "h2" >h2. Bootstrap heading</p> <p class= "h3" >h3. Bootstrap heading</p> <p class= "h4" >h4. Bootstrap heading</p> <p class= "h5" >h5. Bootstrap heading</p> <p class= "h6" >h6. Bootstrap heading</p>

4 Digit Random Number In Php Code Example

Example 1: random number generator in php you can use rand() function for that in php. Example: Generate random numbers between 1 to 50 <?php echo rand ( 1 , 50 ) ; ?> Example 2: php random 5 digit number $limit = 3 ; echo random_int ( 10 ** ( $limit - 1 ) , ( 10 ** $limit ) - 1 ) ;

C# All Symbols Code Example

Example: what is the or symbol in C# //The or Symbol Is ||

Can A Figcaption Be Restricted To The Width Of A Responsively Sized Image?

Answer : Old question, but I came across the same issue and was able to come up with a fairly neat solution, inspired by this. HTML: <figure> <img src="http://www.placehold.it/300x150" alt="" /> <figcaption>Make me as long as you like</figcaption> </figure>​ CSS: figure { background-color: #fff; padding: 5px; font-size: .875em; display: table; } figure img { display: block; width: 100%; } figcaption { display: table-caption; caption-side: bottom; background: #fff; padding: 0 5px 5px; }​ This ensures the figcaption does not exceed the width of the figure , whilst allowing you to keep max-width on the image. Works in all good browsers and IE8+. There's a Firefox bug that prevents max-width working within elements that are set to display: table . So, instead of using max-width on the image, setting its width to 100% means this works cross-browser. The figure's width will

After Installing With Pip, "jupyter: Command Not Found"

Answer : you did not log out and log in ? It should be on your path to execute. If not, pip installed executables in .local, so in a terminal: ~/.local/bin/jupyter-notebook should start notebook To be able to run jupyter notebook from terminal, you need to make sure that ~/.local/bin is in your path. Do this by running export PATH=$PATH:~/.local/bin for your current session, or adding that line to the end of ~/.bashrc to make your changes last for future sessions (e.g. by using nano ~/.bashrc ). If you edit ~/.bashrc you will need to log out and log back in to make see your changes take effect. Try python -m notebook Or, if you used pip3 to install the notebook: python3 -m notebook On Mac OS Catalina and brewed Python3.7

C++ String Cpy Code Example

Example: c++ string # include <string> std :: string myString = "Hello, World!" ;