Posts

Showing posts from June, 2013

Automatic Carousel Slider In Background - Html Css Code Example

Example: automatic slideshow in html <!--automatic slidshow--> <! DOCTYPE html > < html > < head > < meta name = " viewport " content = " width=device-width, initial-scale=1 " > < style > * { box-sizing : border-box ; } body { font-family : Verdana , sans-serif ; } .mySlides { display : none ; } img { vertical-align : middle ; } /* Slideshow container */ .slideshow-container { max-width : 1000 px ; position : relative ; margin : auto ; } /* Caption text */ .text { color : #f2f2f2 ; font-size : 15 px ; padding : 8 px 12 px ; position : absolute ; bottom : 8 px ; width : 100 % ; text-align : center ; } /* Number text (1/3 etc) */ .numbertext { color : #f2f2f2 ; font-size : 12 px ; padding : 8 px 12 px ; position : absolute ; top : 0 ; } /* The dots/bullets/indicators */ .dot { height : 15 px ; width : 15 px ; margin

Angular UI Bootstrap Vertical Tabs

Answer : Another solution is to create something like this <div class="row"> <div class="col-sm-3"> <ul class="nav nav-tabs nav-stacked nav-pills" role="tablist"> <li ng-class="{'active': view_tab == 'tab1'}"> <a class="btn-lg" ng-click="changeTab('tab1')" href="">My Tab 1</a> </li> <li ng-class="{'active': view_tab == 'tab2'}"> <a class="btn-lg" ng-click="changeTab('tab2')" href="">My Tab 2</a> </li> </ul> </div> <div class="col-sm-9"> <div class="tab-content"> <div class="tab-pane" ng-show="view_tab == 'tab1'"> This is tab 1 content </div> <div class="tab-p

Arduino Serial Read And Write Code Example

Example: arduino serial write /* Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Syntax Serial.write(val) Serial.write(str) Serial.write(buf, len) Parameters Serial: serial port object. val: a value to send as a single byte. str: a string to send as a series of bytes. buf: an array to send as a series of bytes. len: the number of bytes to be sent from the array. */

ANALYZE TABLE..VALIDATE STRUCTURE Runs Forever

Answer : UPDATE: What Worked... So after reading the link from @Raj and reading @ora-600's answer I tried to validate the database with the RMAN command backup check logical validate database; . While this worked fine, it was also clear that it was not looking at everything that the ANALYZE INDEX command would. After trying many different variations, I finally discovered that this command would work: ANALYZE TABLE .. VALIDATE STRUCTURE CASCADE offline; Yep, just switching to OFFLINE appears to fix it. And that eventually led me to this bug# 5752105 on this page: http://www.eygle.com/case/10204_buglist.htm. I am not in a position to prove it right now (cannot apply any patches for the time being), but I strongly suspect that this is what I was running into. So while the question is not fully answered, I am going to mark @ora-600's very helpful answer as correct so that he can collect Paul White's very generous bounty. I think the article Raj quoted (https:

Dynamic Memory Allocation Base And Liit Code Example

Example: dynamic memory allocation int * p = new int ; // request memory * p = 5 ; // store value cout << * p << endl ; // Output is 5 delete p ; // free up the memory cout << * p << endl ; // Output is 0

AnalogRead(0) Or AnalogRead(A0)

Answer : To answer Tyilo's specific questions: analogRead(5) and digitalRead(5) will read from two different places. The former will read from analog channel 5 or A5 and the latter will read from pin 5 which happens to be a digital pin. So yes, if you want to read an analog pin with digitalRead you should be using A5 . Why? analogRead requires a channel number internally but it will allow you to give it a pin number too. If you do give it a pin number it will convert it to its corresponding channel number. As far as I can tell analogRead is the only function which uses a channel number internally, is the only one to allow a channel number, and is the only function with this undocumented pin-to-channel conversion. To understand this let's start off with some examples. If you want to use analogRead on the first analog pin A0 you can do analogRead(0) which uses the channel number or analogRead(A0) which uses the pin number. If you were to use the pin number

Apply Numpy Nonzero Row-wise?

Answer : I did not quite understand what you wanted (maybe an example would help), but two guesses: If you want to see if there are any Trues on a row, then: np.any(a, axis=1) will give you an array with boolean value for each row. Or if you want to get the indices for the True s row-by-row, then testarray = np.array([ [True, False, True], [True, True, False], [False, False, False], [False, True, False]]) collists = [ np.nonzero(t)[0] for t in testarray ] This gives: >>> collists [array([0, 2]), array([0, 1]), array([], dtype=int64), array([1])] If you want to know the indices of columns with a True on row 3, then: >>> collists[3] array([1]) There is no pure array-based way of accomplishing this because the number of items on each row varies. That is why we need the lists. On the other hand, the performance is decent, I tried it with a 10000 x 10000 random boolean array, and it took 774 ms to complete the task.

Python Length Array Code Example

Example 1: size array python size = len ( myList ) Example 2: python get array length # To get the length of a Python array , use 'len()' a = arr . array ( ‘d’ , [ 1.1 , 2.1 , 3.1 ] ) len ( a ) # Output : 3 Example 3: find array length python array = [ 1 , 2 , 3 , 4 , 5 ] print ( len ( arr ) ) Example 4: python array length len ( my_array ) Example 5: find array length in python a = arr . array ( 'd' , [ 1.1 , 2.1 , 3.1 ] ) len ( a )

Add A Discount Programmatically To An Order In Woocommerce 3.2+

Image
Answer : The only available feature to make a discount programmatically for an Order , is tricking the Fee API . For info, this trick is not recommended by woocommerce, but used by many people as there is not a discount feature in Woocommerce outside Coupons. The following function will allow you to make a fixed discount of any amount or a percentage discount. The order need to exist (to be saved before) . The function code (For Woocommerce versions 3.2+) : /** * Add a discount to an Orders programmatically * (Using the FEE API - A negative fee) * * @since 3.2.0 * @param int $order_id The order ID. Required. * @param string $title The label name for the discount. Required. * @param mixed $amount Fixed amount (float) or percentage based on the subtotal. Required. * @param string $tax_class The tax Class. '' by default. Optional. */ function wc_order_add_discount( $order_id, $title, $amount, $tax_class = '' ) { $order = wc_ge

Bootstrap 3: How To Make A Centered Navbar

Answer : This should be exactly what you are looking for. Here is a jsFiddle Demo If you want this as a fixed-footer, just add navbar-fixed-bottom class to the <nav class="navbar navbar-default" role="navigation"> element. HTML <nav class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li cla

Bootstrap Social Media Icons Example

Example: bootstrap social media icons Refer link : https://www.programmingquest.com/2020/04/create-social-media-icon-using-html-css.html < html > < head > < title > Social Media Icon Example </ title > <!-- Adding font awesome icon library --> < link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css " > < style > .fa { width : 25 px ; padding : 20 px ; font-size : 25 px ; text-align : center ; text-decoration : none ; margin : 5 px 2 px ; color : white ; border-radius : 50 % ; } .fa :hover { opacity : 0.7 ; } .fa-facebook { background : #3B5998 ; } .fa-twitter { background : #55ACEE ; } .fa-google { background : #dd4b39 ; } .fa-linkedin { background : #007bb5 ; } .fa-

62 Inches To Cm Code Example

Example: inch to cm 1 inch = 2.54 cm