Posts

Showing posts from June, 2006

Css Vertical-align: Middle Not Working Code Example

Example: css vertical-align not working <div class="outer" > <div class="inner"/ > </div > .outer { display : flex ; align-items : center ; justify-content : center ; }

Adminlte 3 Download Code Example

Example: adminlte npm install admin-lte@^3.0 --save

Add Circle Ci Status Badge Code Example

Example: add circle ci status badge template # Template: [![ < ORG_NAME > ](https://circleci.com/ < VCS > / < ORG_NAME > / < PROJECT_NAME > .svg?style=svg)]( < LINK > ) # Example: [![CircleCI](https://circleci.com/gh/circleci/circleci-docs.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs) # Example for specific branch: [![CircleCI](https://circleci.com/gh/circleci/circleci-docs/tree/teesloane-patch-5.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs/?branch=teesloane-patch-5)

Create A Function In R With If Else If Code Example

Example 1: ifelse in r > a = c ( 5 , 7 , 2 , 9 ) > b = ifelse ( a %% 2 == 0 , "even" , "odd" ) # b: odd odd even odd Example 2: if and else if in r if ( test_expression1 ) { statement1 } else if ( test_expression2 ) { statement2 } else if ( test_expression3 ) { statement3 } else { statement4 }

Curl -F Flag Code Example

Example 1: curl I flag User - I flag to only retrieve headers of a curl request : curl - I [ url ] Example 2: curl s flag curl - s flag = Silent or quiet mode . Don't show progress meter or error messages . Makes Curl mute .

Confirm Password Validation In Javascript Code Example

Example 1: password and confirm password validation js var check = function ( ) { if ( document . getElementById ( 'password' ) . value == document . getElementById ( 'confirm_password' ) . value ) { document . getElementById ( 'message' ) . style . color = 'green' ; document . getElementById ( 'message' ) . innerHTML = 'matching' ; } else { document . getElementById ( 'message' ) . style . color = 'red' ; document . getElementById ( 'message' ) . innerHTML = 'not matching' ; } } Example 2: javascript password matching let pass1 = document . getElementById ( "pass-one" ) ; let pass2 = document . getElementById ( "pass-two" ) ; let run = document . getElementById ( "run" ) ; run . addEventListener ( "click" , function ( ) { if ( pass1 . value !== pass2 . value ) { pass1 . style .

Can't Login After Suspend On Ubuntu 17.10

Answer : CrashPlan Solution The problem for me was CrashPlan keeping too many files open while I was away. After rebooting, I looked in /etc/log/syslog and found "No space left on device" errors around the time of my login failure. If you use CrashPlan and find similar messages, then this might work for you too. Messages like: Dec 11 13:01:43 myDesktop systemd[1]: anacron.service: Failed to add inotify watch descriptor for control group /system.slice/anacron.service: No space left on device Dec 11 13:36:15 myDesktop gdm-password]: AccountsService: Failed to monitor logind session changes: No space left on device Dec 11 13:36:40 myDesktop systemd[1]: apt-daily.service: Failed to add inotify watch descriptor for control group /system.slice/apt-daily.service: No space left on device The instructions on the CrashPlan site worked for me (please read before trying on your system): https://support.code42.com/CrashPlan/4/Troubleshooting/Linux_real-time_file_watching_errors

An Object Code Example

Example 1: What is an object The Object is the real-time entity having some state and behavior. In Java, Object is an instance of the class having the instance variables as the state of the object and the methods as the behavior of the object. The object of a class can be created by using thenewkeyword Example 2: [object Object] [object Object] /* This means that your programming interpreter doesn't support showing JSON parsers somewhere, and has resorted to the default object representation behavior (see below). Behavior: [object CLASS] Since it's an object, well: [object Object] This is most commonly seen in a depraved, deranged state in objects ingrained into text. We still haven't really devised a prophecy about why it still happens in some places. Either JavaScript likes to be vexing by being "open" aka adding unnecessary steps, or JavaScript has something like security issues related to its code/some other predicament reta

Android WorkManager Worker Can Not Be Injected Using Dagger Hilt `@WorkerInject`

Answer : As per the WorkManager Configuration and Initialization documentation, to use the Configuration.Provider interface on your Application , you must remove the default initializer: <!-- In your AndroidManifest.xml --> <provider android:name="androidx.work.impl.WorkManagerInitializer" android:authorities="${applicationId}.workmanager-init" tools:node="remove" /> Otherwise, the default initializer will still run, wiping out your custom intialization and its HiltWorkerFactory .

Angular JS: What Is The Need Of The Directive’s Link Function When We Already Had Directive’s Controller With Scope?

Image
Answer : After my initial struggle with the link and controller functions and reading quite a lot about them, I think now I have the answer. First lets understand , How do angular directives work in a nutshell: We begin with a template (as a string or loaded to a string) var templateString = '<div my-directive>{{5 + 10}}</div>'; Now, this templateString is wrapped as an angular element var el = angular.element(templateString); With el , now we compile it with $compile to get back the link function. var l = $compile(el) Here is what happens, $compile walks through the whole template and collects all the directives that it recognizes. All the directives that are discovered are compiled recursively and their link functions are collected. Then, all the link functions are wrapped in a new link function and returned as l . Finally, we provide scope function to this l (link) function which further executes the wrapped link functions

Callout Limits For Future Methods And Queueable Apex

Image
Answer : I quickly wrote a class with future method to test this behaviour. public class FutureClassLimitsTest { @future(callout=true) public static void docallouts(){ for(Integer i=0;i<200;i++){ Http http=new Http(); HttpRequest hr=new HttpRequest(); hr.setMethod('POST'); hr.setEndpoint('https://google.com'); http.send(hr); } } } This is the error I get. First error: Too many callouts: 101. So I believe this is uniform for the whole platform irrespective of the transaction(Sync or Async). Is there a workaround? Well unless there is a strong business requirement it is kinda bad doing so many callous in a transaction. We can call a Queauble Method from Queueable method,.. and you can chain them infinitely. Thus using proper implementation you can have 100+ callouts. Batch is another way to tackle this. You have to write /modify data model add a some queue cus

Android - Flip Image In Xml

Image
Answer : Use the scale attributes in ImageView android:scaleX="-1" //To flip horizontally or android:scaleY="-1" //To flip vertically Here's a very short and easy to understand solution. Add this to the imageView: android:rotationX="180" This will flip the imageView horizontally (left<->right). For vertically, put this: android:rotationY="180" Example: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="original image:"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/test"/> &

==> Click Here <== Code Example

Example 1: html open things in new tab The home page will open in another tab. Example 2: ==> click here <== ==> CLICK HERE <==

C# Wpf Margin Order Code Example

Example: set margin programmatically wpf c# test.Margin = new Thickness(0, -5, 0, 0);

75 Cm In Inches Code Example

Example: cm to inch 1 cm = 0.3937 inch

Css3 Shape Generator Code Example

Example: how to create a shape in css div { clip-path : polygon ( 100 % 100 % , 100 % 100 % , 100 % 100 % ) }

Composer Dump-autoload Or Update Results In Fatal Error On Laravel 5.5

Answer : I just found a solution to this problem. Here it is for those who have the same problem. I have had to delete the directory kylekatarnls located inside my vendor directory then run composer update --prefer-source and after that composer dump-autoload . Now all is working just fine. It seems like you're using Composer v2. If so, read on... Composer v2 adds some new functions to their Plugin interface (namely deactivate() and uninstall() ) However kylekatarnls/update-helper < v1.2.1 is implementing said interface but does not implement the new functions . So to fix, you'll need to update kylekatarnls/update-helper to the latest (v1.2.1 at time of writing), which contains a fix (implements the missing methods): composer update kylekatarnls/update-helper I remove the vendor directory and the composer.lock file. After execute composer install and all works well.

Convert Double To Float Android Code Example

Example: from double to float android studio float myFloat = ( float ) doubleVar ;

Required Css Class Asterisk Code Example

Example 1: html5 astrix for absolutely required field inside a td tag <label class="required" > Name:</label > <input type="text" > <style > .required :after { content : " *" ; color : red ; } </style> Example 2: red asterix css <span style= "color:#ff0000" >*</span>

Lineargradient Html To Css Code Example

Example 1: linear gradient css /* A gradient tilted 100 degrees, starting gray and finishing black */ .class { background : linear-gradient ( 100 deg , rgba ( 63 , 63 , 63 , 0.8 ) 0 % , rgba ( 255 , 255 , 255 , 0 ) 25 % ) ; } /* A gradient going from the bottom to top starting red and finishing orange */ .class { background : linear-gradient ( to top , #f32b60 , #ff8f1f ) ; } Example 2: how to make a linear gradient in css /* Add the class name insted of class */ .class { background : linear-gradient ( to top , #000000 , #fffffff ) ; }