Posts

Showing posts from November, 2018

C How To Print Double Tuype Code Example

Example: print double in c # include <stdio.h> int main ( ) { double d = 123.32445 ; //using %f format specifier printf ( "Value of d = %f\n" , d ) ; //using %lf format specifier printf ( "Value of d = %lf\n" , d ) ; return 0 ; }

Bootstrap 3: Pull-right For Col-lg Only

Answer : You could put "element 2" in a smaller column (ie: col-2 ) and then use push on larger screens only: <div class="row"> <div class="col-lg-6 col-xs-6">elements 1</div> <div class="col-lg-6 col-xs-6"> <div class="row"> <div class="col-lg-2 col-lg-push-10 col-md-2 col-md-push-0 col-sm-2 col-sm-push-0 col-xs-2 col-xs-push-0"> <div class="pull-right">elements 2</div> </div> </div> </div> </div> Demo: http://bootply.com/88095 Another option is to override the float of .pull-right using a @media query.. @media (max-width: 1200px) { .row .col-lg-6 > .pull-right { float: none !important; } } Lastly, another option is to create your own .pull-right-lg CSS class.. @media (min-width: 1200px) { .pull-right-lg { float: right; } } UPDATE Bootstrap 4

How To Find Size Of A Dynamic Array C Code Example

Example: how to dynamically allocate array size in c // declare a pointer variable to point to allocated heap space int * p_array ; double * d_array ; // call malloc to allocate that appropriate number of bytes for the array p_array = ( int * ) malloc ( sizeof ( int ) * 50 ) ; // allocate 50 ints d_array = ( int * ) malloc ( sizeof ( double ) * 100 ) ; // allocate 100 doubles // use [] notation to access array buckets // (THIS IS THE PREFERED WAY TO DO IT) for ( i = 0 ; i < 50 ; i ++ ) { p_array [ i ] = 0 ; } // you can use pointer arithmetic (but in general don't) double * dptr = d_array ; // the value of d_array is equivalent to &(d_array[0]) for ( i = 0 ; i < 50 ; i ++ ) { * dptr = 0 ; dptr ++ ; }

Can We Do Web Push Notifications In Chrome Without Using GCM/FCM?

Answer : No, it is not possible to use another push service. In Firefox, you can do it by modifying the dom.push.serverURL preference, but obviously you'd need privileged access to alter the value of the pref. There are third-party services that you can use to implement push notifications, but they will use the Web Push API under the hood (so Autopush on Firefox, GCM/FCM on Chrome). Yes. Using VAPID spec and service worker you can use web push notifications without FCM/GCM. For more information please look into below google docs. https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/how-push-works

Youtube To Mp3 .cc Code Example

Example 1: youtube mp3 converter You can use WebTools , it's an addon that gather the most useful and basic tools such as a synonym dictionary , a dictionary , a translator , a youtube convertor , a speedtest and many others ( there are ten of them ) . You can access them in two clics , without having to open a new tab and without having to search for them ! - Chrome Link : https : //chrome.google.com/webstore/detail/webtools/ejnboneedfadhjddmbckhflmpnlcomge/ Firefox link : https : //addons.mozilla.org/fr/firefox/addon/webtools/ Example 2: youtube to mp3 online This man is doing gods work

Angular 2 - Debouncing A KeyUp Event

Answer : UPDATE: Using RXJS 6 pipe operator: this.subject.pipe( debounceTime(500) ).subscribe(searchTextValue => { this.handleSearch(searchTextValue); }); You could create a rxjs/Subject and call .next() on keyup and subscribe to it with your desired debounceTime. I'm not sure if it is the right way to do it but it works. private subject: Subject<string> = new Subject(); ngOnInit() { this.subject.debounceTime(500).subscribe(searchTextValue => { this.handleSearch(searchTextValue); }); } onKeyUp(searchTextValue: string){ this.subject.next(searchTextValue); } HTML: <input (keyup)="onKeyUp(searchText.value)"> An Update for Rx/JS 6. Using the Pipe Operator. import { debounceTime } from 'rxjs/operators'; this.subject.pipe( debounceTime(500) ).subscribe(searchTextValue => { this.handleSearch(searchTextValue); }); Everything else is the same

A Generic Priority Queue For Python

Answer : You can use Queue.PriorityQueue. Recall that Python isn't strongly typed, so you can save anything you like: just make a tuple of (priority, thing) and you're set. I ended up implementing a wrapper for heapq , adding a dict for maintaining the queue's elements unique. The result should be quite efficient for all operators: class PriorityQueueSet(object): """ Combined priority queue and set data structure. Acts like a priority queue, except that its items are guaranteed to be unique. Provides O(1) membership test, O(log N) insertion and O(log N) removal of the smallest item. Important: the items of this data structure must be both comparable and hashable (i.e. must implement __cmp__ and __hash__). This is true of Python's built-in objects, but you should implement those methods if you want to use the data structure for custom objects. """ def __init__(self, items=[]):

Main Function In Python Code Example

Example 1: python main def main ( ) : print ( "Hello World!" ) if __name__ = = "__main__" : main ( ) Example 2: how to define main in python # Defining main function def main ( ) : print ( "hello World" ) # Using the special variable # __name__ if __name__ = = "__main__" : main ( ) Example 3: __name__== __main__ in python # If the python interpreter is running that module ( the source file ) # as the main program , it sets the special __name__ variable to have # a value “__main__”. If this file is being imported from another # module , __name__ will be set to the module’s name . if __name__ = = '__main__' : # do something Example 4: main function python\ print ( "Hello" ) print ( "__name__ value: " , __name__ ) def main ( ) : print ( "python main function" ) if __name__ = = '__main__' : main ( ) Example 5: p

Adobe Xd How To Crop Images Code Example

Example: how to crop in adobe xd Place the picture in xd. Draw a rectangle on the artboard. (This will maintain the cropped size of img) Select both of them, right click, mask with shape. Adjust the picture to your needs.

Adding A Splash Screen To Flutter Apps

Image
Answer : I want to shed some more light on the actual way of doing a Splash screen in Flutter. I followed a little bit the trace here and I saw that things aren't looking so bad about the Splash Screen in Flutter. Maybe most of the devs (like me) are thinking that there isn't a Splash screen by default in Flutter and they need to do something about that. There is a Splash screen, but it's with white background and nobody can understand that there is already a splash screen for iOS and Android by default. The only thing that the developer needs to do is to put the Branding image in the right place and the splash screen will start working just like that. Here is how you can do it step by step: First on Android (because is my favorite Platform :) ) Find the "android" folder in your Flutter project. Browse to the app -> src -> main -> res folder and place all of the variants of your branding image in the corresponding folders. For example: th

CDN For Bootstrap 3 Code Example

Example 1: bootstrap cdn < link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" > Example 2: bootstrap 3 cdn < ! -- Latest compiled and minified CSS -- > < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity = "sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin = "anonymous" > < ! -- Optional theme -- > < link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity = "sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin = "anonymous" > < ! -- Latest compiled and minified JavaScript -- > < script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integri

Changing The String Format Of The WPF DatePicker

Answer : I have solved this problem with a help of this code. Hope it will help you all as well. <Style TargetType="{x:Type DatePickerTextBox}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <TextBox x:Name="PART_TextBox" Text="{Binding Path=SelectedDate, StringFormat='dd MMM yyyy', RelativeSource={RelativeSource AncestorType={x:Type DatePicker}}}" /> </ControlTemplate> </Setter.Value> </Setter> </Style> It appears, as per Wonko's answer, that you cannot specify the Date format in Xaml format or by inheriting from the DatePicker. I have put the following code into my View's constructor which overrides the ShortDateFormat for the current thread: CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name); ci.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy"; Thread.CurrentThread.CurrentCu

Add Specific Page Of Visio Diagram Into Word Document

Answer : I suspect that you are inserting the link by going to Word's Insert tab, Text group, then clicking the Object dropdown and selecting Object. If you go that route, Word does not offer any of the internal objects in the Visio file. If so, you may find it easier to start with the Visio file open in Visio (one reason is that you don't have to remember the names of all the pages/objects), then Select the tab of the page that you want to link to Click Copy In Word's Home tab, Click the arrow at the bottom of the Paste button Click Paste Special... Click the Paste Link radio button Click the format you want (e.g. Microsoft Visio Drawing object) Click OK Incidentally, (a) you can link to things other than complete pages such as individual shapes and grouped shapes using this technique (or the one described by Johnny Estilles, as long as you know the correct name to use for the shape). (b) I think in Visio you will always get the first page in the close

Visual Studio Code Prettier Shortcut Code Example

Example 1: format code in vs code On Windows Shift + Alt + F . On Mac Shift + Option + F . Example 2: enable prettier vscode ext install esbenp . prettier - vscode

Android 10 Sdk Version? Code Example

Example: android get sdk version if ( android . os . Build . VERSION . SDK_INT == android . os . Build . VERSION_CODES . LOLLIPOP ) { // Code For Android Version higher equal to LOLLIPOP(21) } else if ( android . os . Build . VERSION . SDK_INT > 21 ) { // Code For Android Version higher than LOLLIPOP(21) } else { // Code For Android Version lower than LOLLIPOP(21) }

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