Posts

Showing posts from January, 2010

Bootstrap Select Multiple Dropdown Custom Style Code Example

Example: multiple select dropdown in bootstrap $('select').selectpicker();

Adding A Bend To A Straight Connector In Microsoft Visio 2013

Image
Answer : How can I add to some bends? Click the "Pointer Tool" on the toolbar and highlight the connector line. Press Shift and drag the mid-point handle of the connector line up or down. This will add corners at 90 degree angles to the line with control handles that can be used to manipulate the line further. Tips & Warnings To add corners at angles less than 90 degrees, press control while moving the midpoint of the connector line up or down. To convert a straight line connector to a curved line, right-click on the connector and select "Curved Connector." Source How to Add Corners to Visio Connectors I found the solution on http://packetlife.net/blog/2012/apr/11/drawing-continuous-connectors-visio/ : A connector can be manipulated so that it spawns additional angles by holding the shift or control key while dragging its midpoint. Holding the shift key will break out the middle of the line, creatin

C++ Multiline String Literal

Answer : Well ... Sort of. The easiest is to just use the fact that adjacent string literals are concatenated by the compiler: const char *text = "This text is pretty long, but will be " "concatenated into just a single string. " "The disadvantage is that you have to quote " "each part, and newlines must be literal as " "usual."; The indentation doesn't matter, since it's not inside the quotes. You can also do this, as long as you take care to escape the embedded newline. Failure to do so, like my first answer did, will not compile: const char *text2 = "Here, on the other hand, I've gone crazy \ and really let the literal span several lines, \ without bothering with quoting each line's \ content. This works, but you can't indent."; Again, note those backslashes at the end of each line, they must be immediately before the line ends, they are escaping the newline in the source, so tha

1type' As A Synonym Of Type Is Deprecated Code Example

Example: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)])' 1. pip uninstall numpy 2. pip install numpy==1.16.4

Get Project Path Unity C# Code Example

Example: unity get project file directory void Start ( ) { //Get the path of the Levels folder from Resources string assetsFolderPath = Application . dataPath ; string levelFolder = AssetsFolderPath + "/Resources/Levels" ; //Output the folder's data path to the console Debug . Log ( "dataPath : " + levelFolder ) ; }

Ahref Onclick Javascript Code Example

Example: on click in a tag < a onclick = ' newwin() ' > Anchor </ a >

2000 Dollars In Rupees Code Example

Example 1: 1.2 million dollar in indian rupees 12,00,000 United States Dollar equals 27,81,06,00,000.00 Vietnamese dong Example 2: 50 dollars in rupees print("Why is the Indian rupee goin so low at cost? Example 3: 2000 dollars in rupees 1,46,184.50

Correct Apache AddType Directives For Font MIME Types

Answer : I realize that this question is old, but for anyone looking for a quick copy/paste for adding font MIME types to their .htaccess: <IfModule mod_mime.c> AddType application/vnd.ms-fontobject .eot AddType application/x-font-opentype .otf AddType image/svg+xml .svg AddType application/x-font-ttf .ttf AddType application/font-woff .woff AddType application/font-woff2 .woff2 </IfModule> I just did some research on IANA official list. This appears to be the current state of the play as at May 2013: These three are official and assigned by IANA: svg as "image/svg+xml" woff as "application/font-woff" eot as "application/vnd.ms-fontobject" These are not not official/assigned, and so must use the 'x-' syntax: ttf as "application/x-font-ttf" otf as "application/x-font-opentype" It appears that the 'font' type does not exist

Instagram Logo Website Background Color Code Example

Example: linear gradient instagram background : #f09433 ; background : -moz-linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; background : -webkit-linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; background : linear-gradient ( 45 deg , #f09433 0 % , #e6683c 25 % , #dc2743 50 % , #cc2366 75 % , #bc1888 100 % ) ; filter : progid : DXImageTransform.Microsoft. gradient ( startColorstr= '#f09433' , endColorstr= '#bc1888' , GradientType= 1 ) ;

Add Image In Header Using Html-pdf Node Module

Image
Answer : It is possible to add the image in options header. 1.Load the image in html body with "display:none" style. 2.Then add the image in the options header By doing this the image is cached and can attach the image in header. var options = { "format": 'Letter', "orientation": "portrait", "header": { "contents": "<img src='image path' />", "height": "30mm" }, "footer": { "contents": footer } } pdf.create("<div style='display:none'><img src='image path' /></div>", options).toFile("sample.pdf", function(err, res) { if (err) { console.error(err); callback(); } }); Refering to this issue on the github, you can't put your image directly in options.header , you have to put it in the body inside a <div id=&qu

Copy All Files With Given Extension To Output Directory Using CMake

Answer : I've found the solution by myself: file(GLOB MY_PUBLIC_HEADERS "myDir/*.h" ) file(COPY ${MY_PUBLIC_HEADERS} DESTINATION myDestination) this also works for me: install(DIRECTORY "myDir/" DESTINATION "myDestination" FILES_MATCHING PATTERN "*.h" )

Correct Way To Communicate The Result Of A Background Thread To The Ui Thread In Android

Answer : Background In Android, when an application is launched, the system creates a thread of execution for the application, called main thread (also known as the UI thread). Google introduces the main thread and its responsible as below. The main thread has a very simple design: Its only job is to take and execute blocks of work from a thread-safe work queue until its app is terminated. The framework generates some of these blocks of work from a variety of places. These places include callbacks associated with lifecycle information, user events such as input, or events coming from other apps and processes. In addition, app can explicitly enqueue blocks on their own, without using the framework. Nearly any block of code your app executes is tied to an event callback, such as input, layout inflation, or draw. When something triggers an event, the thread where the event happened pushes the event out of itself, and into the main thread’s message queue. The main thread can then servic

Auto Indent In Vscode Code Example

Example 1: visual studio code auto indent On Windows Shift + Alt + F On Mac Shift + Option + F On Ubuntu Ctrl + Shift + I Example 2: indent code in vs code The code formatting is available in Visual Studio Code through the following shortcuts : On Windows : Shift + Alt + F On Mac : Shift + Option + F On Linux : Ctrl + Shift + I Example 3: visual studio code windows auto indent Shift + Alt + F Example 4: viscode format automatico { // Controls if the editor should automatically format the line after typing "beautify.onSave" : true , "editor.formatOnSave" : true , // You can auto format any files based on the file extensions type. "beautify.JSfiles" : [ "js" , "json" , "jsbeautifyrc" , "jshintrc" , "ts" ] }

Add Elements Into Array List Java Code Example

Example: how to add to an arraylist java import java . util . ArrayList ; public class Details { public static void main ( String [ ] args ) { //ArrayList<String> Declaration ArrayList < String > al = new ArrayList < String > ( ) ; //add method for String ArrayList al . add ( "Ram" ) ; al . add ( "Shyam" ) ; al . add ( "CPS" ) ; al . add ( "John" ) ; al . add ( "Steve" ) ; System . out . println ( "Elements of ArrayList of String Type: " + al ) ;

What Is 1000 Factorial Code Example

Example 1: factorial of 0 factorial ( 0 ) = 1 Example 2: factorial unsigned long long factorial ( unsigned long long num ) { if ( num <= 0 ) return 1 ; return num * factorial ( num - 1 ) ; }

Cookie Clicker Addon Code Example

Example 1: cookie clicker #Hacks: # Type these in your console which you can open by # pressing STRG + SHIFT + J (Chrome) or STRG + SHIFT + K (Firefox) # changes the amount of cookies Game.cookies = amount in int # unlimted cookies Game.cookies = Infinity # If you want to get out of Infinity cookies Game.cookiesd = 0 # set up the CookiesPerSecond Rate by the number you want Game.cookiesPS= amount in int # clicks on cookie forever without moving your mouse in the highest speed var autoclicker = setInterval(function() { Game.ClickCookie(); }, 10); # stoping autoclicker clearInterval(autoClicker) # clicks on golden cookie without moving your mouse setInterval(Game.goldenCookie.click, 500) # Get the achievement you want by changing it to the achievement name you want # Game.Win(‚ACHIEVEMENT‘) Example 2: cookie clicker edit : you have to use Game.cookiesPs not Game.cookiesPS Example 3: cookie clicker Game.cookies

How To Check Postgresql Version Code Example

Example 1: check postgres version psql --version Example 2: check postgres version in ubuntu $ locate bin/postgres /usr/lib/postgresql/ 9.3 /bin/postgres Example 3: get postgres version postgres -V // or psql --version Example 4: postgresql version command # SSH psql --version # SQL SELECT version ( ) ; Example 5: postgres version command SELECT version ( ) ;

Microsoft Azure Storage Emulator Download Code Example

Example: azure storage emulator config Account name : devstoreaccount1 Account key : Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq / K1SZFPTOtr / KBHBeksoGMGw ==

Amazon Video Login Code Example

Example: prime video This platform is addictive as hell. Stay away if you wanna be productive

!npm Mysql2 Code Example

Example: npm mysql $ npm install mysql

How To Disable Button Html Code Example

Example 1: html button disabled <button type= "button" disabled>This button is disabled</button> Example 2: disable input type button in html <input type= "button" disabled value= "Submit" > Example 3: enable html button $ ( '#Button' ) . prop ( 'disabled' , true ) ;