Posts

Showing posts from January, 2009

Border Length Percentage Css Code Example

Example 1: css border length . page - title : after { content : "" ; /* This is necessary for the pseudo element to work. */ display : block ; /* This will put the pseudo element on its own line. */ margin : 0 auto ; /* This will center the border. */ width : 50 % ; /* Change this to whatever width you want. */ padding - top : 20 px ; /* This creates some space between the element and the border. */ border - bottom : 1 px solid black ; /* This creates the border. Replace black with whatever color you want. */ } Example 2: how to set border length in css without div div { width : 200 px ; height : 50 px ; position : relative ; z - index : 1 ; background : #eee ; } div : before { content : "" ; position : absolute ; left : 0 ; bottom : 0 ; height : 1 px ; width : 50 % ; /* or 100px */ border - bottom : 1 px solid magenta ; }

Create Kml From Csv In Python

Answer : You didn't answer the query above, but my guess is that the error is that you're not closing your output file (which would flush your output). f.close() use etree to create your file http://docs.python.org/library/xml.etree.elementtree.html It's included with Python and protects you from generating broken XML. (eg. because fname contained & , which has special meaning in XML.)

Css Overflow Hidden No Scrollbar Code Example

Example 1: hide scrollbar css /* Hide scrollbar for Chrome, Safari and Opera */ .scrollbar-hidden ::-webkit-scrollbar { display : none ; } /* Hide scrollbar for IE, Edge add Firefox */ .scrollbar-hidden { -ms-overflow-style : none ; scrollbar-width : none ; /* Firefox */ } Example 2: hide the scrollbar in css if not overflow .myClass { /*auto will remove and add the scroll bar as needed*/ overflow : auto ; } Example 3: javascript hide scrollbar function HideScrollbar ( ) { var style = document. createElement ( "style" ) ; style .innerHTML = `body ::-webkit-scrollbar { display : none ; } ` ; document.head. appendChild ( style ) ; }

Adding Custom Functions Into Array.prototype

Answer : Modifying the built-in object prototypes is a bad idea in general, because it always has the potential to clash with code from other vendors or libraries that loads on the same page. In the case of the Array object prototype, it is an especially bad idea, because it has the potential to interfere with any piece of code that iterates over the members of any array, for instance with for .. in . To illustrate using an example (borrowed from here): Array.prototype.foo = 1; // somewhere deep in other javascript code... var a = [1,2,3,4,5]; for (x in a){ // Now foo is a part of EVERY array and // will show up here as a value of 'x' } Unfortunately, the existence of questionable code that does this has made it necessary to also avoid using plain for..in for array iteration, at least if you want maximum portability, just to guard against cases where some other nuisance code has modified the Array prototype. So you really need to do both: you should avoid

Hdri Sky Unity Code Example

Example: should i use unity hdrp no you should not use unity hdrp

How To Use Media Queries Bootstrap 4 Code Example

Example 1: bootstrap media queries /* Large desktops and laptops */ @media ( min-width : 1200 px ) { } /* Landscape tablets and medium desktops */ @media ( min-width : 992 px ) and ( max-width : 1199 px ) { } /* Portrait tablets and small desktops */ @media ( min-width : 768 px ) and ( max-width : 991 px ) { } /* Landscape phones and portrait tablets */ @media ( max-width : 767 px ) { } /* Portrait phones and smaller */ @media ( max-width : 480 px ) { } Example 2: bootstrap breakpoints // Small devices ( landscape phones , 576 px and up ) @media ( min-width : 576 px ) { ... } // Medium devices ( tablets , 768 px and up ) @media ( min-width : 768 px ) { ... } // Large devices ( desktops , 992 px and up ) @media ( min-width : 992 px ) { ... } // Extra large devices ( large desktops , 1200 px and up ) @media ( min-width : 1200 px ) { ... } Example 3: bootstrap media queries /* Answer to: "bootstrap media queries" */ /* Since Boot

Can I Remove Files In /var/log/journal And /var/cache/abrt-di/usr?

Answer : journal logs Yes you can delete everything inside of /var/log/journal/* but do not delete the directory itself. You can also query journalctl to find out how much disk space it's consuming: $ journalctl --disk-usage Journals take up 3.8G on disk. You can control the size of this directory using this parameter in your /etc/systemd/journald.conf : SystemMaxUse=50M You can force a log rotation: $ sudo systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service NOTE: You might need to restart the logging service to force a log rotation, if the above signaling method does not do it. You can restart the service like so: $ sudo systemctl restart systemd-journald.service abrt logs These files too under /var/cache/abrt-di/* can be deleted as well. The size of the log files here is controlled under: $ grep -i size /etc/abrt/abrt.conf # Max size for crash storage [MiB] or 0 for unlimited MaxCrashReportsSize = 1000 You can control the max s

Css Height In Percent Not Working

Answer : You need to set a 100% height on all your parent elements, in this case your body and html. This fiddle shows it working. html, body { height: 100%; width: 100%; margin: 0; } div { height: 100%; width: 100%; background: #F52887; } <html><body><div></div></body></html> Make it 100% of the viewport height: div { height: 100vh; } Works in all modern browsers and IE>=9, see here for more info. height: 100% works if you give a fixed size to the parent element.

C Warning Implicit Declaration Of Function 'exit'

Answer : Add: #include <stdlib.h> to the top of your program. Do you have this preprocessor? If not, add it. #include <stdlib.h> exit() is a library function, the respecive prototypes are present in the stdlib.h header file, inoder to call the process to specified code for exit function, you need to attach the as #include stdlib.h header in your program. that is the reason we should add the stdlib.h header. eventhough you can run the program, but it shows the warning message like below: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default] but, this kind of program not recommended, we need to take care of what we are given in the program,be cautious. warning may leads runtime error.

Topological Sorting Gfg Code Example

Example: topological sort cp algorithms int n ; // number of vertices vector < vector < int >> adj ; // adjacency list of graph vector < bool > visited ; vector < int > ans ; void dfs ( int v ) { visited [ v ] = true ; for ( int u : adj [ v ] ) { if ( ! visited [ u ] ) dfs ( u ) ; } ans . push_back ( v ) ; } void topological_sort ( ) { visited . assign ( n , false ) ; ans . clear ( ) ; for ( int i = 0 ; i < n ; ++ i ) { if ( ! visited [ i ] ) dfs ( i ) ; } reverse ( ans . begin ( ) , ans . end ( ) ) ; }

Can You Use If/else Conditions In CSS?

Answer : Not in the traditional sense, but you can use classes for this, if you have access to the HTML. Consider this: <p class="normal">Text</p> <p class="active">Text</p> and in your CSS file: p.normal { background-position : 150px 8px; } p.active { background-position : 4px 8px; } That's the CSS way to do it. Then there are CSS preprocessors like Sass. You can use conditionals there, which'd look like this: $type: monster; p { @if $type == ocean { color: blue; } @else if $type == matador { color: red; } @else if $type == monster { color: green; } @else { color: black; } } Disadvantages are, that you're bound to pre-process your stylesheets, and that the condition is evaluated at compile time, not run time. A newer feature of CSS proper are custom properties (a.k.a. CSS variables). They are evaluated at run time (in browsers supporting them). With them you could do somet

Google Cla\ Code Example

Example: class <p class= "ThisIsAClassName" >Class</p>

Why & Is Typed After Vector In C++ Code Example

Example: declare vectors c++ vector < int > vec ; //Creates an empty (size 0) vector vector < int > vec ( 4 ) ; //Creates a vector with 4 elements. /*Each element is initialised to zero. If this were a vector of strings, each string would be empty. */ vector < int > vec ( 4 , 42 ) ; /*Creates a vector with 4 elements. Each element is initialised to 42. */ vector < int > vec ( 4 , 42 ) ; vector < int > vec2 ( vec ) ; /*The second line creates a new vector, copying each element from the vec into vec2. */

A4 Paper Size Height And Width Code Example

Example: Paper size a4 2480 x 3508 pixels at 300 PPI 595 x 842 pixels at 72 PPI

Accessing External Storage In Android API 29

Answer : On Android 10 Environment.getExternalStorageDirectory() and Environment.getExternalStoragePublicDirectory() will return storage paths but paths are not readable or writable. For Android 10 you can continue to use paths provided by Environment.getExternalStorageDirectory() and Environment.getExternalStoragePublicDirectory() if you add android:requestLegacyExternalStorage="true" to application tag in manifest file. At runtime your app can call Environment.isExternalStorageLegacy() to check if the request has been done. Another (not known) possibility (only for Android 10) is to add <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> to manifest file. The user has to go to the advanced settings of the app and enable from Advanced settings Install unknown apps | Allow from this source . The nice thing with this is that the user can switch the access rights. You can make it easier for the user if you implement an int

Web Whatsapp Url Link Code Example

Example: link whatsapp to website < ! -- link the following URL to the desired icon or button in your code : https : //wa.me/PhoneNumber (see the example below) remember to include the country code -- > < a href = 'https://wa.me/27722840005' target = '_blank' > < i class = "fa fa-whatsapp" > < / i > < / a >

Angular2 NgFor OnPush Change Detection With Array Mutations

Answer : Angular2 change detection doesn't check the contents of arrays or object. A hacky workaround is to just create a copy of the array after mutation this.myArray.push(newItem); this.myArray = this.myArray.slice(); This way this.myArray refers a different array instance and Angular will recognize the change. Another approach is to use an IterableDiffer (for arrays) or KeyValueDiffer (for objects) // inject a differ implementation constructor(differs: KeyValueDiffers) { // store the initial value to compare with this.differ = differs.find({}).create(null); } @Input() data: any; ngDoCheck() { var changes = this.differ.diff(this.data); // check for changes if (changes && this.initialized) { // do something if changes were found } } See also https://github.com/angular/angular/blob/14ee75924b6ae770115f7f260d720efa8bfb576a/modules/%40angular/common/src/directives/ng_class.ts#L122 You might want to use markForCheck method from ChangeDetect

Select First Child Javascript Code Example

Example 1: first child element javascript Both these will give you the first child node : console. log ( parentElement.firstChild ) ; // or console. log ( parentElement.childNodes[ 0 ] ) ; If you need the first child that is an element node then use : console. log ( parentElement.children[ 0 ] ) ; Example 2: how to add first child using js var eElement ; // some E DOM instance var newFirstElement ; //element which should be first in E eElement. insertBefore ( newFirstElement , eElement.firstChild ) ; Example 3: javascript select first element // example : document. querySelector ( '.message' ) // syntax : // document. querySelector ( '.<class-name>' )

A4 Paper Pixel Size Code Example

Example: Paper size a4 2480 x 3508 pixels at 300 PPI 595 x 842 pixels at 72 PPI