Posts

Showing posts from August, 2015

Bootstrap Responsive Table Scss Codepen Code Example

Example: responsive bootstrap table < table class = " table " > < thead > < tr > < th scope = " col " > # </ th > < th scope = " col " > First </ th > < th scope = " col " > Last </ th > < th scope = " col " > Handle </ th > </ tr > </ thead > < tbody > < tr > < th scope = " row " > 1 </ th > < td > Mark </ td > < td > Otto </ td > < td > @mdo </ td > </ tr > < tr > < th scope = " row " > 2 </ th > < td > Jacob </ td > < td > Thornton </ td > < td > @fat </ td > </ tr > < tr > < th scope = " row " > 3 </ th > < td > Larry </ td &

Close Current Tab

Answer : You can only close windows/tabs that you create yourself. That is, you cannot programmatically close a window/tab that the user creates. For example, if you create a window with window.open() you can close it with window.close() . As of Chrome 46, a simple onclick=window.close() does the trick. This only closes the tab, and not the entire browser, if multiple tabs are opened. You can use below JavaScript. window.open('','_self').close(); In a HTML you can use below code <a href="javascript:close_window();">close</a> I have tried this in Chrome 61 and IE11 it is working fine. But this is not working with Firefox 57. In Firefox we can only close, windows which opened using below command. window.open()

Acid Properties In Dbms Geeksforgeeks Code Example

Example: acid properties in dbms Atomicity The entire transaction take place at once or doesn't happen at all. Consistency Database must be consistent before and after the transaction. Isolation Multiple transactions occur independently without interference. Durability The changes of the successful transaction occurs even if the system failure occur.

(0x8007045b) Code Example

Example: 0x80070643 Use Windows Defender Command-Line Tool to Update the Signatures Alternately, you can use the Windows Defender command-line tool MpCmdrun.exe to update the signatures. Open an Admin Command Prompt window and type these two commands exactly: "%ProgramFiles%\Windows Defender\MPCMDRUN.exe" -RemoveDefinitions -All "%ProgramFiles%\Windows Defender\MPCMDRUN.exe" -SignatureUpdate The first command removes any installed signature and engine files, and this option is used when you have difficulties trying to update signatures. The 2nd command checks for the latest updates and installs it. In case the 2nd command fails with an error, use the alternate command to update the definitions directly from the Microsoft Malware Protection Center ( MMPC ) servers: "%ProgramFiles%\Windows Defender\MPCMDRUN.exe" -SignatureUpdate -MMPC

Bootstrap 4 Fixed Top Nav And Fixed Sidebar

Answer : The sticky-top is working, but it doesn't appear to be working for two reasons... There isn't enough content in the main content area to scroll It's positioned at top:0 so it hides behind the fixed navbar Add CSS to offset the top of the sidebar (the same as height of fixed navbar). .sticky-offset { top: 56px; } <ul class="list-group sticky-top sticky-offset">..(sidebar)..</div> And, then add enough content (or height) in the main area so that scrolling is necessary... Working Demo: https://www.codeply.com/go/7XYosZ7VH5 <nav class="navbar navbar-expand-md navbar-dark bg-primary fixed-top"> .. </nav> <div class="row"> <div id="sidebar-container" class="sidebar-expanded col-2 d-none d-md-block"> <ul class="list-group sticky-top sticky-offset"> <li>Menu item..</li> <li>Menu item..<

Xenforo Themes Code Example

Example: xolo themeforest #header h1 a { display : block ; width : 300 px ; height : 80 px ; }

100 F To C Code Example

Example 1: fahrenheit to celsius formula cels = ( fahr - 32.0 ) * 5.0 / 9.0 ; //Fahr to cels fahr = ( cels * 9.0 / 5.0 ) + 32.0 ; //Cels to fahr Example 2: convert fahrenheit to celsius import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int far = sc . nextInt ( ) ; int cel = ( far - 32 ) * 5 / 9 ; System . out . printf ( "%d Fahrenheit is %d Celsius" , far , cel ) ; } } Example 3: c to f let f = c * ( 9 / 5 ) + 32 ; let c = ( f - 32 ) * ( 5 / 9 ) ; Example 4: 14 f to c 14 ° F = - 10 ° C

C# Regex For Guid

Answer : This one is quite simple and does not require a delegate as you say. resultString = Regex.Replace(subjectString, @"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$", "'$0'"); This matches the following styles, which are all equivalent and acceptable formats for a GUID. ca761232ed4211cebacd00aa0057b223 CA761232-ED42-11CE-BACD-00AA0057B223 {CA761232-ED42-11CE-BACD-00AA0057B223} (CA761232-ED42-11CE-BACD-00AA0057B223) Update 1 @NonStatic makes the point in the comments that the above regex will match false positives which have a wrong closing delimiter. This can be avoided by regex conditionals which are broadly supported. Conditionals are supported by the JGsoft engine, Perl, PCRE, Python, and the .NET framework. Ruby supports them starting with version 2.0. Languages such as Delphi, PHP, and R that have regex features based on PCRE also support conditionals. (source http://www.regular-expressions.info/c

Code Indentation Phpstorm Shortcut Code Example

Example: format code intellij // Mac CMD + Option + L // Windows Ctrl + Alt + L

Bootstrap Responsive Navbar Examples

Example: navbar bootstrap 4 < nav class = " navbar navbar-expand-lg navbar-light bg-light " > < a class = " navbar-brand " href = " # " > Navbar </ a > < button class = " navbar-toggler " type = " button " data-toggle = " collapse " data-target = " #navbarSupportedContent " aria-controls = " navbarSupportedContent " aria-expanded = " false " aria-label = " Toggle navigation " > < span class = " navbar-toggler-icon " > </ span > </ button > < div class = " collapse navbar-collapse " id = " navbarSupportedContent " > < ul class = " navbar-nav mr-auto " > < li class = " nav-item active " > < a class = " nav-link " href = " # " > Home < span class = " sr-only " > (current) </ spa

Array Map With Key Php Code Example

Example 1: using array map php array_map ( callable $callback , array $array1 [ , array $ ... ] ) : array Example 2: array map php The array_map() function sends each value of an array to a user-made function, and returns an array with new values, given by the user-made function. Tip: You can assign one array to the function, or as many as you like. Syntax array_map(functionname, array1, array2, array3, ...) Example Send each value of an array to a function, multiply each value by itself, and return an array with the new values: <?php function myfunction ( $val ) { return ( $val * $val ) ; } $a = array ( 1 , 2 , 3 , 4 , 5 ) ; print_r ( array_map ( "myfunction" , $a ) ) ; ?> Example 3: php array map $func = function cube ( $n ) { return ( $n * $n * $n ) ; } $a = [ 1 , 2 , 3 , 4 , 5 ] ; $b = array_map ( $func , $a ) ; // Outputs: Array ( // [0] => 2 // [1] => 4 // [2] => 6 // [3] =

Cherry Mx Blue Vs Gateron Blue Code Example

Example: cherry mx blue vs gateron blue If you like concrete and less wobling, go cherry. Otherwise to save cost go gateron. For me cherry has way better typing feel.

Check Mongoose Connection State Without Creating New Connection

Answer : Since the mongoose module exports a singleton object, you don't have to connect in your test.js to check the state of the connection: // test.js require('./app.js'); // which executes 'mongoose.connect()' var mongoose = require('mongoose'); console.log(mongoose.connection.readyState); ready states being: 0: disconnected 1: connected 2: connecting 3: disconnecting I use this for my Express Server mongoDB status, where I use the express-healthcheck middleware // Define server status const mongoose = require('mongoose'); const serverStatus = () => { return { state: 'up', dbState: mongoose.STATES[mongoose.connection.readyState] } }; // Plug into middleware. api.use('/api/uptime', require('express-healthcheck')({ healthy: serverStatus })); Gives this in a Postman request when the DB is connected. { "state": "up", "dbState": "conne

Ls Cmd Code Example

Example 1: ls equivalent in CMD Use the command dir to list all the directories and files in a directory Example 2: ls command ls command list computer files in a directory in Unix OS with next structure : ls [ OPTION ] . . . [ FILE ] . . . Examples : ls - l #display all files in current directory with ( - l ) long format . ls - a / directory #display all hidden files in given directory that start with . Example 3: use ls in windows echo @dir % * > % systemroot % \system32\ls . bat Make sure you are running cmd as admin

Can You Add Friends On The PSN Website?

Image
Answer : The ability to add friends via the website is a popular feature request (a quick Google search will turn up dozens of threads going back years asking for it), but it has never been added. So as of now, you can only do it through the PlayStation 3, PlayStation Vita, or PlayStation 4 (oddly, you can't even add friends on the PSP). Still can't add friends from the website, but you can use the official PlayStation iOS/Android app : Very old question, but in case someone is googling this, now you can do it: https://my.playstation.com/ and navigate to "Friends". From there you can now search, add friends, manage requests and everything else you could only do in the app before.

Protected Cpp Code Example

Example: protected in c++ # include <iostream> // Visibility is how visible certain members or methods of class are , who can see them ,who can call them and who can use them //Visibility has no effect on performance of your program it is ust for organizing code //Three basic visibility modifers are: //1 private //2 public //3 protected //default visibility of a struct is public //default visibility of class is private class Entity { protected : //means all sub classes and base class can access these functions and variables butcan't be accessed outside classes int P ; void InitP ( ) { P = 0 ; //initializes P to 0 } public : //Pubic methods and variables can be accessed inside and outside of the class int a , b ; void Init ( ) { a = 0 ; b = 0 ; } private : //only entity class can read and write the variables exeption is friend int X , Y ; void print ( ) { // Content // only this function can be acess

304 Response Code Meaning Code Example

Example: 304 http status code 304 Not Modified The HTTP 304 Not Modified client redirection response code indicates that there is no need to retransmit the requested resources. It is an implicit redirection to a cached resource. This happens when the request method is safe, like a GET or a HEAD request, or when the request is conditional and uses a If-None-Match or a If-Modified-Since header. The equivalent 200 OK response would have included the headers Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

128-bit Values - From XMM Registers To General Purpose

Answer : You cannot move the upper bits of an XMM register into a general purpose register directly. You'll have to follow a two-step process, which may or may not involve a roundtrip to memory or the destruction of a register. in registers (SSE2) movq rax,xmm0 ;lower 64 bits movhlps xmm0,xmm0 ;move high 64 bits to low 64 bits. movq rbx,xmm0 ;high 64 bits. punpckhqdq xmm0,xmm0 is the SSE2 integer equivalent of movhlps xmm0,xmm0 . Some CPUs may avoid a cycle or two of bypass latency if xmm0 was last written by an integer instruction, not FP. via memory (SSE2) movdqu [mem],xmm0 mov rax,[mem] mov rbx,[mem+8] slow, but does not destroy xmm register (SSE4.1) mov rax,xmm0 pextrq rbx,xmm0,1 ;3 cycle latency on Ryzen! (and 2 uops) A hybrid strategy is possible, e.g. store to memory, movd/q e/rax,xmm0 so it's ready quickly, then reload the higher elements. (Store-forwarding latency is not much worse than ALU, though.) That gives you a bal

Angular Firebase Npm Code Example

Example 1: npm install @angular/fire firebase –save npm install firebase @angular / fire Example 2: install angular fire ng add @angular / fire

38 C To F Code Example

Example: 14 f to c 14 °F = - 10 °C