Posts

Js A Onclick Code Example

Example 1: javascript onclick document .getElementById ( "myBtn" ) .addEventListener ( "click" , function ( ) { alert ( "Hello World!" ) ; } ) ; Example 2: javascript onclick // The element id ( TheElementID ) and var name ( myElement ) can be named anything. var myElement = document. getElementByID ( 'TheElementID' ) ; myElement .onclick = function ( ) { // Carry out a function here... }

Border In Container Flutter Code Example

Example 1: flutter container border Container ( decoration : BoxDecoration ( border : Border . all ( color : Colors . red , // red as border color ) , ) , child : Text ( "Your text..." ) ) Example 2: container flutter border radius Container ( decoration : BoxDecoration ( color : Colors . blue , borderRadius : BorderRadius . all ( Radius . circular ( 10 ) ) ) ) Example 3: border for container in flutter new Container ( margin : const EdgeInsets . all ( 15.0 ) , padding : const EdgeInsets . all ( 3.0 ) , decoration : BoxDecoration ( border : Border . all ( color : Colors . blueAccent ) ) , child : Text ( "My Awesome Border" ) , ) Example 4: border side in flutter import 'package : flutter / material . dart' ; void main ( ) { runApp ( MyApp ( ) ) ; } class MyApp extends StatelessWidget { @ override Widget build ( BuildContext context ) { return Center ( ...

Conditional Count On A Field

Answer : I think you may be after select jobID, JobName, sum(case when Priority = 1 then 1 else 0 end) as priority1, sum(case when Priority = 2 then 1 else 0 end) as priority2, sum(case when Priority = 3 then 1 else 0 end) as priority3, sum(case when Priority = 4 then 1 else 0 end) as priority4, sum(case when Priority = 5 then 1 else 0 end) as priority5 from Jobs group by jobID, JobName However I am uncertain if you need to the jobID and JobName in your results if so remove them and remove the group by, Using COUNT instead of SUM removes the requirement for an ELSE statement: SELECT jobId, jobName, COUNT(CASE WHEN Priority=1 THEN 1 END) AS Priority1, COUNT(CASE WHEN Priority=2 THEN 1 END) AS Priority2, COUNT(CASE WHEN Priority=3 THEN 1 END) AS Priority3, COUNT(CASE WHEN Priority=4 THEN 1 END) AS Priority4, COUNT(CASE WHEN Priority=5 THEN 1 END) AS Priority5 FROM TableName GROUP BY jobId, jobName IIF is not a standard SQL construct...

Brave Browser Wiki Code Example

Example 1: brave browser sudo apt install apt-transport-https curl gnupg curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add - echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list sudo apt update sudo apt install brave-browser Example 2: brave web browser sudo pacman -S brave sudo pacman -S brave-beta

Add Code Block To Google Docs Code Example

Example: how to add code in google docs How to use Code Blocks Using Code Blocks is equally simple. Open Google Docs and create a new document. With the document open, click Add-ons and select Code Blocks from the menu. A new right sidebar will open (Figure A), where you can make use of the tool.

Woocommerce Update Cart Ajax Hook Code Example

Example: woocommerce update mini cart ajax add_filter ( 'woocommerce_add_to_cart_fragments' , function ( $fragments ) { ob_start ( ) ; ? > < div class = "cart-contents" > < ? php echo WC ( ) -> cart -> get_cart_contents_count ( ) ; ? > < / div > < ? php $fragments [ 'div.cart-contents' ] = ob_get_clean ( ) ; return $fragments ; } ) ; add_filter ( 'woocommerce_add_to_cart_fragments' , function ( $fragments ) { ob_start ( ) ; ? > < div class = "header-quickcart" > < ? php woocommerce_mini_cart ( ) ; ? > < / div > < ? php $fragments [ 'div.header-quickcart' ] = ob_get_clean ( ) ; return $fragments ; } ) ;

Could Not Load File Or Assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0

Answer : Dont know if this is good to anyone, but search all these dlls: Microsoft.ReportViewer.Common.dll Microsoft.ReportViewer.ProcessingObjectModel.dll Microsoft.ReportViewer.WebForms.dll Microsoft.ReportViewer.WinForms.dll Microsoft.ReportViewer.DataVisualization.dll You find them in C:\Windows\assembly\GAC_MSIL\... , and then put them in the references of your project. For each of them say: local copy, and check for 32 or 64 bit solution. You can install the Microsoft Report Viewer 2012 Runtime and change your references so they point to the ones installed by the runtime. http://www.microsoft.com/en-gb/download/details.aspx?id=35747 I have installed the runtime without it asking for SQL Server 2012. Before installing try uninstalling any previous versions of report viewer. As Microsoft.ReportViewer.2012.Runtime has Microsoft.ReportViewer.WebForms , Microsoft.ReportViewer.Common and Microsoft.ReportViewer.ProcessingObjectModel libraries, just run this command on PM Console: ...

Can I Delete MSOCache?

Answer : Short answer: no . You would most likely no longer be able to perform a repair or install additional components. I have tried it myself on a virtual machine running Windows 7 with Office 2007–I imagine it would have the same effect on Office 2010. A safer option (as suggested here) is to burn the folder itself to DVD or move it to a USB drive, and change all references to it in the Windows registry. From that page: Solution, what I did recently: Burn that whole folder to a CD-R or DVD (the filesize of that folder depends upon your Office version). Delete that folder. Search the registry in RegEdit for C:\MSOCache and change all references to point to your CD/DVD drive, example: E:\MSOCache (will of course require the disc when something Office related needs those cache files.) Way to go would be Junction Point. For example, if you have 120 GB SSD Drive as C: , and 3TB Drive (Magnetic) HDD as D: : on drive D: create sub folder named C cut and paste folder ...

String Length C++ Stl Code Example

Example 1: length of string c++ // string::length # include <iostream> # include <string> int main ( ) { std :: string str ( "Test string" ) ; std :: cout << "The size of str is " << str . length ( ) << " bytes.\n" ; return 0 ; } Example 2: length of string in c++ str . length ( ) ; Example 3: create a string of length c++ # include <string> # include <iostream> int main ( ) { std :: string s ( 21 , '*' ) ; std :: cout << s << std :: endl ; return 0 ; }

Android Toast Example

Example 1: java android show toast Toast myToast = Toast.makeText(this, "I'm a toast!", Toast.LENGTH_LONG); myToast.show(); Example 2: toast code in android studio Toast toast = Toast.makeText(this, "message", Toast.LENGTH_LONG;); toast.show(); Example 3: android java toast Toast.makeText(context this, text "Example of Text", Toast.LENGTH_LONG).show(); Example 4: Toast messag eandroid Toast.makeText(context, text, duration).show(); Example 5: toast.maketext Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); Example 6: android studio Toast usage Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show();

Controlling The Amount Of Space In Justify-content: Space-between

Answer : The justify-content property uses the available space on the line to position flex items. With justify-content: space-between , all available space is placed between the first and last items, pushing both items to opposite edges of the container. You wrote: I was wondering how to justify how much space is allowed in justify-content: space-between for flexbox. With space-between in row-direction, you would have to control the width of the flex container. So if you want there to be less space between flex items, then you would need to shorten the width of the container. Or you could use justify-content: space-around . However, these solutions are suboptimal. The right way to go about this would be to use margins. You wrote: Currently, my items are spaced but they have way too much space between them I want just a little space between them so they can settle somewhere in the middle in a row. Use justify-content: center then use margins to space them apart. I find mysel...

C++ Difference Between Std::ref(T) And T&?

Answer : Well ref constructs an object of the appropriate reference_wrapper type to hold a reference to an object. Which means when you apply: auto r = ref(x); This returns a reference_wrapper and not a direct reference to x (ie T& ). This reference_wrapper (ie r ) instead holds T& . A reference_wrapper is very useful when you want to emulate a reference of an object which can be copied (it is both copy-constructible and copy-assignable ). In C++, once you create a reference (say y ) to an object (say x ), then y and x share the same base address . Furthermore, y cannot refer to any other object. Also you cannot create an array of references ie code like this will throw an error: #include <iostream> using namespace std; int main() { int x=5, y=7, z=8; int& arr[] {x,y,z}; // error: declaration of 'arr' as array of references return 0; } However this is legal: #include <iostream> #include <functional> // ...

Getforegroundwindow Code Example

Example 1: c# getforegroundwindow [ DllImport ( "user32.dll" ) ] private static extern IntPtr GetForegroundWindow ( ) ; Example 2: c# get foreground window # region Retrieve list of windows [ DllImport ( "user32" ) ] private static extern int GetWindowLongA ( IntPtr hWnd , int index ) ; [ DllImport ( "USER32.DLL" ) ] private static extern int GetWindowText ( IntPtr hWnd , StringBuilder lpString , int nMaxCount ) ; [ DllImport ( "USER32.DLL" ) ] private static extern bool EnumWindows ( EnumWindowsProc enumFunc , int lParam ) ; [ DllImport ( "user32.dll" ) ] private static extern IntPtr GetForegroundWindow ( ) ; private const int GWL_STYLE = - 16 ; private const ulong WS_VISIBLE = 0x10000000L ; private const ulong WS_BORDER = 0x00800000L ; private const ulong TARGETWINDOW = WS_BORDER | WS_VISIBLE ; internal class Window { ...

Make Css Element Spin Code Example

Example: css spinning animation /* How to use : <div class="spinning"></div>*/ .spinning { animation-name : spin ; animation-duration : 1500 ms ; /* How long lasts 1 turn */ animation-iteration-count : infinite ; animation-timing-function : linear ; } @keyframes spin { from { transform : rotate ( 0 deg ) ; } to { transform : rotate ( 360 deg ) ; } }

Android - Create New Labels In Gmail App

Answer : As of current writing, it seems that it's (still) impossible to create a new label in Android Gmail app. From Google Gmail official support, Create a label On a computer, open Gmail. You can't create labels from the Gmail app. On the left, click More . Click Create new label . Name your label. Click Create . (Emphasis mine) If Inbox App is installed on the device and has access to Gmail ID, then from Inbox App, it is possible to create a Gmail Label, and the same will be SYNC to Gmail App. There is an option in Inbox App's Navigation drawer (sliding menu) to create new Gmail Labels. Not sure why the same is not made available in the official Gmail App itself, because the app is developed by the Gmail Team only. How I found I could create a new label on Android: Open Android Chrome. Invoke Gmail within Chrome (via that 3x3 grid selector), which opens the Mobile version of Gmail. Open an email & scroll to the bottom and you'll see: ...

Css Font Color Red Code Example

Example 1: text color css .class { color : white ; } Example 2: text color css body { color : blue ; } h1 { color : green ; } Example 3: css change text color p { color : White ; } Example 4: css font color color : #ffffff ; /*!important; to overwrite inline css*/ Example 5: css font color color : #ffffff ;