Posts

Showing posts from September, 2010

Youtube Converter Mp4 Hd Video Code Example

Example: youtube to mp4 ytmp3 . cc is the best by far

Activate Virtualization Without Bios Code Example

Example: enable virtualization in bios Inside bios setting > tweaker settings > Advance CPU setting > Enable SVM Mode

Custom Add To Cart Button Woocommerce Ajax Code Example

Example: add_to_cart how to call it woocommerce add_action ( 'template_redirect' , 'quadlayers_add_to_cart_function' ) ; function quadlayers_add_to_cart_function ( ) { $product_id = 1326 ; if ( WC ( ) -> cart -> get_cart_contents_count ( ) == 0 ) { WC ( ) -> cart -> add_to_cart ( $product_id ) ; } }

Share Link Whatsapp Link Code Example

Example: whatsapp share link for website < a href = "https://api.whatsapp.com/send?text=www.google.com" data - action = "share/whatsapp/share" > Share via Whatsapp web < / a >

How To Use CFrame Roblox Code Example

Example: Cframe guide -- //Normal CFrame CFrame . new ( 0 , 0 , 0 ) -- //Quaternion CFrame CFrame . new ( 5 , 5 , 5 , 0 , 0 , 0 , 0 ) W , X , Y , Z

Composition And Aggregation In Python

Answer : If I understand correctly, aggregation vs composition is about the responsibilities of an object to its members (e.g. if you delete an instance, do you also delete its members?). Mainly, it will depend a lot on the implementation. For example, to create a class A which receives an instance of class B (aggregation), you could write the following: class B(object): pass class A(object): def __init__(self, b): self.b = b b = B() a = A(b) But as a point of caution, there is nothing built-in to Python that will prevent you from passing in something else, for example: a = A("string") # still valid If you would like to create the instance of B inside the constructor of A (composition), you could write the following: class A(object): def __init__(self): self.b = B() Or, you could inject the class into the constructor, and then create an instance, like so: class A(object): def __init__(self, B): self.b = B() As an aside, in at least your

Conversion String To Int Javascript Code Example

Example 1: how to convert string to int js let string = "1" ; let num = parseInt ( string ) ; //num will equal 1 as a int Example 2: javascript convert string to number var myInt = parseInt ( "10.256" ) ; //10 var myFloat = parseFloat ( "10.256" ) ; //10.256

Add Leaf Js Code Example

Example 1: leafletjs openstreets example var OpenStreetMap_Mapnik = L . tileLayer ( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' , { maxZoom : 19 , attribution : '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' } ) ; var OpenAIP = L . tileLayer ( 'http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.{ext}' , { attribution : '<a href="https://www.openaip.net/">openAIP Data</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-NC-SA</a>)' , ext : 'png' , minZoom : 4 , maxZoom : 14 , tms : true , detectRetina : true , subdomains : '12' } ) ; Example 2: leafletjs openstreets example var OpenStreetMap_Mapnik = L . tileLayer ( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' , { maxZoom : 19 ,

Bootstrap Material Design Cdn Code Example

Example 1: md bootstrap cdn <!-- Font Awesome --> < link rel = " stylesheet " href = " https://use.fontawesome.com/releases/v5.8.2/css/all.css " > <!-- Google Fonts --> < link rel = " stylesheet " href = " https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap " > <!-- Bootstrap core CSS --> < link href = " https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css " rel = " stylesheet " > <!-- Material Design Bootstrap --> < link href = " https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css " rel = " stylesheet " > Example 2: md bootstrap cdn <!-- JQuery --> < script type = " text/javascript " src = " https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js " > </ script > <!-- Bootstrap tooltips --> < scrip

Bootstrapcdn Bootstrap 4 Css Cdn Code Example

Example 1: bootstrap 4 cdn <!-- Boostrap 4 CSS --> < link rel = " stylesheet " href = " https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css " integrity = " sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh " crossorigin = " anonymous " > < script src = " https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js " integrity = " sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6 " crossorigin = " anonymous " > </ script > <!-- Boostrap JS --> < script src = " https://code.jquery.com/jquery-3.4.1.slim.min.js " integrity = " sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n " crossorigin = " anonymous " > </ script > < script src = " https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js " integrity = &qu

Create Function Must Be The Only Statement In The Batch

Answer : The function needs to be either the only function in the query window OR the only statement in the batch. If there are more statements in the query window, you can make it the only one "in the batch" by surrounding it with GO's. e.g. GO CREATE FUNCTION getLavel(@id int ,@lavel char) RETURNS date BEGIN DECLARE @date date select @date = (select authorization_date from Authorized WHERE diver_number = @id and @lavel =level_name) return @date END GO Turn this into an inline table valued function. This will perform better than the scalar function. Also, you should NOT use the default sizes for character datatypes. Do you know what the default length for a char is? Did you know that it can vary based on usage? CREATE FUNCTION getLavel ( @id int , @lavel char --You need to define the length instead of the default length ) RETURNS table return select authorization_date from Authorized WHERE diver_number = @id and @lavel = level_

Can Scrapy Be Used To Scrape Dynamic Content From Websites That Are Using AJAX?

Image
Answer : Here is a simple example of scrapy with an AJAX request. Let see the site rubin-kazan.ru. All messages are loaded with an AJAX request. My goal is to fetch these messages with all their attributes (author, date, ...): When I analyze the source code of the page I can't see all these messages because the web page uses AJAX technology. But I can with Firebug from Mozilla Firefox (or an equivalent tool in other browsers) to analyze the HTTP request that generate the messages on the web page: It doesn't reload the whole page but only the parts of the page that contain messages. For this purpose I click an arbitrary number of page on the bottom: And I observe the HTTP request that is responsible for message body: After finish, I analyze the headers of the request (I must quote that this URL I'll extract from source page from var section, see the code below): And the form data content of the request (the HTTP method is "Post"): And

Cross-browser Window Resize Event - JavaScript / JQuery

Answer : jQuery has a built-in method for this: $(window).resize(function () { /* do something */ }); For the sake of UI responsiveness, you might consider using a setTimeout to call your code only after some number of milliseconds, as shown in the following example, inspired by this: function doSomething() { alert("I'm done resizing for the moment"); }; var resizeTimer; $(window).resize(function() { clearTimeout(resizeTimer); resizeTimer = setTimeout(doSomething, 100); }); $(window).bind('resize', function () { alert('resize'); }); Here is the non-jQuery way of tapping into the resize event: window.addEventListener('resize', function(event){ // do stuff here }); It works on all modern browsers. It does not throttle anything for you. Here is an example of it in action.

Sleep Cpp Code Example

Example 1: cpp thread sleep // this_thread::sleep_for example # include <iostream> // std::cout, std::endl # include <thread> // std::this_thread::sleep_for # include <chrono> // std::chrono::seconds int main ( ) { std :: cout << "countdown:\n" ; for ( int i = 10 ; i > 0 ; -- i ) { std :: cout << i << std :: endl ; std :: this_thread :: sleep_for ( std :: chrono :: seconds ( 1 ) ) ; } std :: cout << "Lift off!\n" ; return 0 ; } Example 2: c++ sleep function # include <chrono> # include <thread> std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( x ) ) ; Example 3: sleep c++ windows # include <Windows.h> Sleep ( number of milliseconds ) ; Example 4: sleep in c++ linux # include <unistd.h> sleep ( 10 ) ; Example 5: sleep c++ # include <unistd.h> unsigned int sleep ( unsigned int

Sarcoline Colour Code Code Example

Example: sarcoline colour code Colour : SARCOLINE Hex Code : #FFDDAA RGB : ( 255 , 221 , 170 )

Create Element With Class Name Javascript Code Example

Example 1: create element javascript with class // create div element by javascript with class var div = document . createElement ( 'div' ) ; div . className = "div1" ; Example 2: element.classname javascript let el = document . getElementById ( 'item' ) ; if ( el . className === 'active' ) { el . className = 'inactive' ; } else { el . className = 'active' ; }

Html Css Rotate Image Code Example

Example 1: rotate image html .img { transform : rotate ( 90 deg ) ; } Example 2: image rotate with css div { width : 80 px ; height : 80 px ; background-color : skyblue ; } .rotated { transform : rotate ( 45 deg ) ; /* Equal to rotateZ(45deg) */ background-color : pink ; }