Posts

Showing posts from July, 2018

All Prime Numbers From 1 To 1000 Code Example

Example: primes from 1 to 1000 For all those who need this and want to copy pasta it, here you go {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199,211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397,401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599,601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797,809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997} # Made by: TheDarkLord

Css Font Style Italic Code Example

Example 1: italic css font-style : italic ; Example 2: font-style css #example { font-style : normal ; /* no specification, default */ font-style : italic ; /* font is italic */ font-style : oblique ; /* font is italic, even if italic letters are not specified for font family */ font-style : inherit ; /* inherit property from parent */ font-style : initial ; /* default value */ } Example 3: css how to make text italic /* I know i already made a HOW TO MAKE CSS TEXT ITALIC but here's one 100% css */ #italic-selector { font-style : italic ; }

Connection MongoTimeoutError: Server Selection Timed Out After 30000 Ms Code Example

Example 1: mongotimeouterror: server selection timed out after 30000 ms This error happen if MongoDB server is not running or mongoDB URL is not proper. Is your mongoDB installed locally or it's on cloud? Also please check your connection of mongo using ROBO 3T or compass. -Thanks Example 2: mongotimeouterror: server selection timed out after 30000 ms just go to mongodb atlas admin panel.Go in security tab>Network Access> Then whitelist your IP by adding it See this image to locate the particular menu Note:Check your IP on google then add it

Odd Css Code Example

Example 1: css odd even child tr :nth-child ( even ) { background : #CCC } tr :nth-child ( odd ) { background : #FFF } Example 2: nth-child() css /* Selects the second <li> element in a list */ li :nth-child ( 2 ) { color : lime ; } /* Selects every fourth element among any group of siblings */ :nth-child ( 4n ) { color : lime ; } Example 3: css nth child /* Select the first list item */ li :nth-child ( 1 ) { } /* Select the 5th list item */ li :nth-child ( 5 ) { } /* Select every other list item starting with first */ li :nth-child ( odd ) { } /* Select every 3rd list item starting with first */ li :nth-child ( 3n ) { } /* Select every 3rd list item starting with 2nd */ li :nth-child ( 3n - 1 ) { } /* Select every 3rd child item, as long as it has class "el" */ .el :nth-child ( 3 ) { } Example 4: css nth child :nth-child ( 3 ) { //the number is the child number you are targeting //styles here } Example 5: select odd child css li :nth

Cron Job Every 15 Minutes Code Example

Example 1: run cron every 15 minutes */15 * * * * Example 2: cron job every 10 minutes */10 * * * * will run every 10 min.

Array Find Index Php Code Example

Example 1: get index of element in array php $array = array ( 0 => 'blue' , 1 => 'red' , 2 => 'green' , 3 => 'red' ) ; $key = array_search ( 'green' , $array ) ; // $key = 2; $key = array_search ( 'red' , $array ) ; // $key = 1; Example 2: array_search in php < ? php $array = array ( 0 => 'blue' , 1 => 'red' , 2 => 'green' , 3 => 'red' ) ; $key = array_search ( 'green' , $array ) ; // $key = 2; $key = array_search ( 'red' , $array ) ; // $key = 1; ? > Example 3: php array get value at index $array = array ( 'foo' => 'bar' , 33 => 'bin' , 'lorem' => 'ipsum' ) ; $array = array_values ( $array ) ; echo $array [ 0 ] ; //bar echo $array [ 1 ] ; //bin echo $array [ 2 ] ; //ipsum Example 4: get element by index array php $array = array ( 'foo' => 'bar

Descendant Selector Css Code Example

Example 1: descendent selector in css The descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor ( parent , parent 's parent, parent' s parent's parent , etc ) element matching the first selector . example : h1 ul { border : 1 px solid #f1f1f1 ; } Explanation : This above CSS code snippet will select all the 'ul' ( unordered list ) tags which are preceeded by an 'h1' ( header tag ) . /*the best way to understand is to practice by implemetation. Create a html file with lots of h1 and ul elements to understand by implementing CSS on them*/ Example 2: css select descendant with class Select an element with the ID "id" and the class "class" : # id . class { } example : < div > < strong id = "id" class = "class" > Foobar

6 Feet 5 Inches In Cm Code Example

Example: 6 foot 5 to cm 6foot 5inches is 195,58 cm

Html Fit Image To Div Code Example

Example 1: css image fit in div with aspect ratio img { width : 100 % ; height : 100 % ; object-fit : contain ; } Example 2: resize img to fit img { max-width : 100 % ; height : auto ; } Example 3: make image stretch to fit div Just apply without any changing any code img { width : 100 % ; }

Copy Image To Clipboard From Browser In Javascript?

Answer : No, you can't copy images to the clipboard. Copying anything to the clipboard is a security limitation of every browser, but you may able to copy text to the clipboard in IE if they have the proper security settings. Here Mozilla lists some of the problems caused by programmatic access to the clipboard. Yes, most of the scripts supports text only. http://forums.mozillazine.org/viewtopic.php?f=25&t=1195035&start=0 The above site also discussing the same issue. The following site said related to security issues, http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard but this won't work in latest version of Mozilla. The last answer is from 2010 and browsers have changed a lot since then. With this simple function, you can copy whatever you want (text, images, tables, etc) (on your page) to the clipboard. The function receive the element id or the element itself. function copyElementToClipboard(element) { window.getSelection().removeAllRanges

Amd Ryzen 5 3550h Vs Amd Ryzen 5 2500u Code Example

Example: ryzen 5 vs intel i5 10th gen AMD won by 1 point overall they all are dope

Android Location Api Without Fused Location Provider Code Example

Example: fused location provider client implementation implementation 'com.google.android.gms:play-services-location:15.0.1'

Convert Milliseconds To Date In Mongodb Aggregation Pipeline For Group By?

Answer : I'm trying to get the logic behind converting the txnTime field to a date object because grouping by either a date field or a timestamp in milliseconds (like what you are presently doing) will yield the same result as they both are unique in their respective formats! To change the txnTime field to a date object you should then include a $project pipeline before the $group pipeline stage with this expression "txnTime": { "$add": [ new Date(0), "$txnTime" ] } so that you can do your $group operation on the converted/projected txnTime field: var convertedTxnTime = { "$add": [new Date(0), "$txnTime"] }; /* If using MongoDB 4.0 and newer, use $toDate var convertedTxnTime = { "$toDate": "$txnTime" }; or $convert var convertedTxnTime = { "$convert": { "input": "$txnTime", "to": "date" } }; */ db.campaign_wallet.aggregate([ { "$match&

Converting Kotlin's KClass To Regular Class In Java

Answer : The functionality does exist, just not where it seems to, as java is an extension property. Use the method JvmClassMappingKt.getJavaClass . In Kotlin, extension methods (and property getters/setters) are implemented as static methods of their containing class. If you look at the source for .java ( Ctrl + Q ), you can see that it is implemented in JvmClassMapping.kt . As the function is package-level and does not have a containing object, it is simply placed into the file [Filename]Kt which in this case is JvmClassMappingKt . Here is the source of this extension property: @Suppress("UPPER_BOUND_VIOLATED") public val <T> KClass<T>.java: Class<T> @JvmName("getJavaClass") get() = (this as ClassBasedDeclarationContainer).jClass as Class<T> As you can see, the method's name is renamed on the JVM to getJavaClass . In your case, you can try: public <T> T proxy(KClass<T> kClass) { return (T) proxy(JvmClassM

Convert Rem To Px Code Example

Example 1: 38px to rem converter 32px = 2rem Example 2: 33px to rem 33px 2.0625rem

After Upload A File In Android Firebase Storage How Get The File Download Url? GetDownloadUrl() Not Working

Answer : I had Found 2 solution for my issue. Firebase Google Documentation : //add file on Firebase and got Download Link filePath.putFile(imageUri).continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() { @Override public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception { if (!task.isSuccessful()){ throw task.getException(); } return filePath.getDownloadUrl(); } }).addOnCompleteListener(new OnCompleteListener<Uri>() { @Override public void onComplete(@NonNull Task<Uri> task) { if (task.isSuccessful()){ Uri downUri = task.getResult(); Log.d(TAG, "onComplete: Url: "+ downUri.toString()); } } }); Another solution! It's more easy and small than google Firebase documentation and I'll use it: filePath.putFile(imageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.Task

Margin Bottom Class In Bootstrap 4 Code Example

Example 1: bootstrap Margin and padding Use the margin and padding spacing utilities to control how elements and components are spaced and sized. Bootstrap 4 includes a five-level scale for spacing utilities , based on a 1 rem value default $spacer variable. Choose values for all viewports ( e.g. , .mr-3 for margin-right : 1 rem ) , or pick responsive variants to target specific viewports ( e.g. , .mr-md-3 for margin-right : 1 rem starting at the md breakpoint ) . <div class= "my-0 bg-warning" >Margin Y 0 </div> <div class= "my-1 bg-warning" >Margin Y 1 </div> <div class= "my-2 bg-warning" >Margin Y 2 </div> <div class= "my-3 bg-warning" >Margin Y 3 </div> <div class= "my-4 bg-warning" >Margin Y 4 </div> <div class= "my-5 bg-warning" >Margin Y 5 </div> <div class= "my-auto bg-warning" >Margin Y Auto</div> Examp