Posts

Showing posts from January, 2006

Count Number Of Li Element And Add Class

Answer : Your query looks for .box1 li within .box2 , though these two elements are siblings. Therefore, your find() query will always return 0 . For your query to work, your HTML would need to look like this: <div class="box2">text <ul class="box1"> <li>a</li> <li>b</li> <li>c</li> </ul> </div> Without altering the structure of your HTML , you can get this to work by accessing .box1 li directly: $('.box2').addClass(function(){ return 'list' + $('.box1 li').length; }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <ul class="box1"> <li>a</li> <li>b</li> <li>c</li> </ul> <div class="box2">text</div> Here $(this) is referring to box2 element.Only $('.box1 li').length is what you required $('.box

Converting Php String To Title Case

Image
Answer : This should work for you: <?php $str = "Name: MR. M.A.D KARIM"; $result = ""; $arr = array(); $pattern = '/([;:,-.\/ X])/'; $array = preg_split($pattern, $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); foreach($array as $k => $v) $result .= ucwords(strtolower($v)); //$result = str_replace("Mr.", "", $result); ->If you don't want Mr. in a String echo $result; ?> Input: Name: MR. M.A.D KARIM Address: 12/A, ROOM NO-B 13 Output: Name: M.A.D Karim Address: 12/A, Room No-B 13 Use Stringy composer.json "require": { "voku/stringy": "~5.0" } PHP Stringy::create('string')->toTitleCase()

Cannot Find FileMerge (opendiff Tool) But I Have Xcode 4.6 Installed

Answer : FileMerge is located at within Xcode. From the command-line: cd /Applications/Xcode.app/Contents/Applications/ open . Go into that directory once it opens: Right-click on the app Choose "Make alias" Move that alias to your Applications directory You're all set. Strange. "XCode 4.5, where is FileMerge ?" suggests: The FileMerge that is bundled with Xcode 4.5 doesn't work as a standalone application. I tried compressing it from the application bundle. I was able to expand it to show the FileMerge app on the desktop. But when I tried to run it I got an error saying it couldn't be opened. Apple's developer downloads site has every version of Xcode. You could try trashing your current version of Xcode 4.5, downloading Xcode 4.5 from the developer downloads site, and see if FileMerge is there. If not, you can download Xcode 4.4 and see if that has FileMerge. Indeed, I downloaded a fresh new install o

Exponent In C Code Example

Example 1: Write a Program to find exponential without using pow() method # include <stdio.h> int main ( ) { int base , exp ; long long result = 1 ; printf ( "Enter a base number: " ) ; scanf ( "%d" , & base ) ; printf ( "Enter an exponent: " ) ; scanf ( "%d" , & exp ) ; while ( exp != 0 ) { result *= base ; -- exp ; } printf ( "Answer = %lld" , result ) ; return 0 ; } Example 2: power func in c The function pow ( ) is used to calculate the power raised to the base value . It takes two arguments . It returns the power raised to the base value . It is declared in “math . h” header file . Example 3: powers of 2 in cpp // If not using any extra libraries // Powers of 2. If finding 2^n int main ( ) { int ans = 1 >> n ; } // Suppose we want to find x ^ y void power ( int x , int y ) { int ans = 1 ;

Emotion Js Examples

Example: emotion css npm i @emotion/styled @emotion/react

Android Phone Not Showing In Visual Studio Code Example

Example: mobile device not showing in android studio Enable Developer option from device settings Worked for me

Button Onclick Javascript Code Example

Example 1: javascript onclick document.getElementById("myBtn").addEventListener("click", function() { alert("Hello World!"); }); Example 2: HTML button onclick <! DOCTYPE html > < html > < head > < title > Title of the document </ title > </ head > < body > < p > There is a hidden message for you. Click to see it. </ p > < button onclick = " myFunction() " > Click me! </ button > < p id = " demo " > </ p > < script > function myFunction ( ) { document . getElementById ( "demo" ) . innerHTML = "Hello Dear Visitor!</br> We are happy that you've chosen our website to learn programming languages. We're sure you'll become one of the best programmers in your country. Good luck to you!" ; } </ script > </ body > </ html > Ex

Coreldraw 2019 Keygen Xforce Free Download Code Example

Example: xforce keygen 2018 free download XForce Keygen For Life Time 100% Working IMD-43V-UF1-BF4 8EJ-D9I-9UL-4N4 XHU-9A9-66I-LXB EK9-9W2-N00-2A0 KWI-39K-41G-QTM JQV-256-DQ6-UID Y4P-69M-M0D-HFB DGW-DH1-ZAW-YLZ EGM-FMJ-6W4-UEI 35X-KM6-OCV-1FQ P25-6TI-QA9-PHK SHY-2LL-0XF-MCI 3W9-THZ-90C-EBU XAB-V8T-VXI-BQU 95S-D1K-VOJ-2MG CRH-RIJ-OGL-MIJ WE2-2VJ-B9Q-GN6 AYB-3X4-3GL-0IR 47V-OIZ-8LR-QU3 ML1-X9N-0V9-O70

Crypt Mine Code Example

Example: mine crypto Salad uses your PC to mine crypto while you are AFK, they automatically mine the most profitable coin your machine can handle, increasing your overall return. You keep 100% of the profits earned through mining and pay a small fee when you purchase an item in-store. You can use your balance to purchase items like Discord Nitro, Prepaid VISA Cards, Amazon Credit and more. Earning Methods: Crypto Mining, Power Web 3.0, Complete Offerwalls Use code D4RHUL for a 2x earning rate bonus! At: https://www.salad.io TrustPilot: https://trustpilot.com/review/salad.io

Convert Word Doc, Docx And Excel Xls, Xlsx To PDF With PHP

Answer : I found a solution to my issue and after a request, will post it here to help others. Apologies if I missed any details, it's been a while since I worked on this solution. The first thing that is required is to install Openoffice.org on the server. I requested my hosting provider to install the open office RPM on my VPS. This can be done through WHM directly. Now that the server has the capability to handle MS Office files you are able to convert the files by executing command line instructions via PHP. To handle this, I found PyODConverter : https://github.com/mirkonasato/pyodconverter I created a directory on the server and placed the PyODConverter python file within it. I also created a plain text file above the web root (I named it "adocpdf"), with the following command line instructions in it: directory=$1 filename=$2 extension=$3 SERVICE='soffice' if [ "`ps ax|grep -v grep|grep -c $SERVICE`" -lt 1 ]; then unset DISPLAY /usr/bin/soffice

Configure Thunderbird To Access Office 365 LDAP Addressbook

Image
Answer : I had some problems using DavMail (mainly with the tray icon). And the calendar was not easy to use. So I've searched deeper. And I found TbSync which works well together with the EAS Provider. It works out of the box. No technical configuration no background process. I just gave my account and password and everything else was detected. Addresses and Calendars are now working like a charm. The only tips you should know with TbSync is that after installing it (as an Tools → Add-ons ) the configuration can be accessed from Tools → Synchronization Settings (TbSync) : ... or alternatively under Tools → Add-on Options → TbSync : The easiest way that I have found is to use the Davmail connector. This is a Java applet that runs in the background on your Windows 10 PC. To Thunderbird it looks like IMAP for receiving email, SMTP for sending it, and LDAP for address book queries. On the Office365 side it talks the native protocols. I've been using it for about five years

Add List To Tuple Python Code Example

Example 1: python add to list list_to_add . append ( item_to_add ) # or list_to_add . push ( item_to_add ) Example 2: how to append list in python list1 = [ "hello" ] list1 = list1 + [ "world" ] Example 3: how to add number in tuple a = ( '2' , ) b = 'z' new = a + ( b , ) Example 4: how to add strings in tuple in python First , convert tuple to list by built - in function list ( ) . You can always append item to list object . Then use another built - in function tuple ( ) to convert this list object back to tuple . You can see new element appended to original tuple representation . by tutorialspoint . com happy coding : D

How To Get Input From Serial Monitor Arduino Code Example

Example: how to print to the serial monitor arduino void setup ( ) { Serial . begin ( 9600 ) ; } void loop ( ) { // This will write to the monitor and end the line Serial . println ( "test text" ) ; // This will write to the monitor but will not end the line Serial . print ( "test text" ) ; }

Android Studio: How To Generate Signed Apk Using Gradle?

Answer : There are three ways to generate your build as per the buildType . (In your case, it's release but it can be named anything you want.) Go to Gradle Task in right panel of Android Studio and search for assembleRelease or assemble(#your_defined_buildtype) under Module Tasks Go to Build Variant in Left Panel and select the build from drop down Go to project root directory in File Explore and open cmd/terminal and run: Linux: ./gradlew assembleRelease or assemble(#your_defined_buildtype) Windows: gradlew assembleRelease or assemble(#your_defined_buildtype) If you want to do a release build (only), you can use Build > Generate Signed apk . For other build types, only the above three options are available. You can find the generated APK in your module/build directory having the build type name in it. It is possible to take any existing Android Studio gradle project and build/sign it from the command line without editing any files. This makes it very n

How To Create New Line In Gitlab Readme File Code Example

Example: Markdown new line Hello ( < -- two spaces ) World

Html Style Align Center Code Example

Example 1: center div horizontally and vertically .parent { position : relative ; } .child { position : absolute ; left : 50 % ; top : 50 % ; transform : translate ( -50 % , -50 % ) ; } Example 2: css center text /* To center text, you need to use text-align. */ .centerText { text-align : center ; /* This puts the text into the center of the screen. */ } /* There are also other things that you can use in text-align: left, right, and justify. Left and right make the test align to the right or left of the screen, while justify makes the text align both sides by spreading out spaces between some words and squishing others. */ Example 3: text align center text-align : center ; Example 4: css text align center body { text-align : center ; }

Strpdate2num Mdates Will Be Remove Code Example

Example: strpdate2num mdates will be remove import matplotlib .pyplot as plt import numpy as np import urllib .request as urq import matplotlib .dates as mdates import requests def bytespdate2num ( fmt , encoding='utf-8' ) : def bytesconverter ( b ) : s = b .decode ( encoding ) return ( mdates .datestr2num ( s ) ) return bytesconverter def graph_data ( ) : stock_price_url='https://pythonprogramming .net /yahoo_finance_replacement' source_code = urq .urlopen ( stock_price_url ) .read ( ) .decode ( ) stock_data = [ ] split_source = source_code .split ( '\n' ) for line in split_source: split_line = line .split ( ' , ' ) if len ( split_line ) is 7: if 'Volume' not in line: stock_data .append ( line ) datep , openp , highp , lowp , closep , ad_closep , vol = np .loadtxt ( stock_data ,

Composer Dump Autoload No Plugin Code Example

Example: composer autoload dump composer dump - autoload

How To Printf Double In C 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 ; }

Angular/Material Mat-form-field Input - Floating Label Issues

Answer : assuming you are using latest stable version of material 2, you can use floatLabel="never" to force label to not to float. here is live working demo this is clear in documentation https://material.angular.io/components/form-field/api <form class="search-form"> <mat-form-field class="example-full-width" appearance="standard"> <input class="toolbar-search" type="text" matInput> <mat-placeholder>Search</mat-placeholder> <mat-icon matSuffix style="font-size: 1.2em">search</mat-icon> </mat-form-field> </form> Please set the appearance of mat-form-field to standard and the placeholder will stop behaving like label. Explanation : By default the mat-label in mat-form-field floats and the appearance of mat-form-field is "legacy". That means if a mat-label is not present with the form field then placeholder will start behavin

How To Set Bootstrap Table Column Width Code Example

Example: bootstrap table col fixed width <table class= "table" > <thead> <tr> <th style= "width: 30%" >Col 1 </th> <th style= "width: 20%" >Col 2 </th> <th style= "width: 10%" >Col 3 </th> <th style= "width: 30%" >Col 4 </th> <th style= "width: 10%" >Col 5 </th> </tr> </thead> <tbody> <tr> <td>Val 1 </td> <td>Val 2 </td> <td>Val 3 </td> <td>Val 4 </td> <td>Val 5 </td> </tr> </tbody> </table>

Css Transition With Visibility Code Example

Example: css transition visibility .m-fadeOut { visibility : hidden ; opacity : 0 ; transition : visibility 0 s linear 300 ms , opacity 300 ms ; } .m-fadeIn { visibility : visible ; opacity : 1 ; transition : visibility 0 s linear 0 s , opacity 300 ms ; }

Convert Pdf To Word Doc Code Example

Example 1: pdf to word Go to the link below! https://smallpdf.com/pdf-to-word Example 2: pdf to word Use smallpdf.com, pdftoword.com or Sejda Example 3: pdf to word Windows 10 (easiest way): 1) Right-click the PDF-Document you want to convert. 2) Choose "Open With". 3) If Word isn't one of the options go to "Choose Another App". 4) Select Word and press the OK-Button. 5) In the next Step Word opens and you're finished. Example 4: pdf to word Just use Adobe Online converter it's free for one time and for more than 1 you may have to sign in, just use a temp mail like "moakt mail" or "temp mail" and u r good to go. Link: https://www.adobe.com/in/acrobat/online/word-to-pdf.html temp mail:https://temp-mail.org/ Example 5: pdf to word use pdftoword.com < p > hi </ p > Example 6: convert pdf to word #my opinion pdfcandy.com

Git Reset Local Changes Code Example

Example 1: git discard local changes # Discarding local changes ( permanently ) to a file : git checkout -- < file > # Discard all local changes to all files permanently : git reset -- hard Example 2: git undo all changes git reset -- hard Example 3: undo unstaged changes git git checkout -- . Example 4: git reset one file git checkout HEAD -- my - file . txt Example 5: revert unstaged changes git git checkout -- path / to / file / to / revert Example 6: git discard staged changes git reset HEAD git checkout .

Css Style Pointer Events From Javascript Code Example

Example: pointer events none javascript document. getElementById ( "id" ) .style.pointerEvents = "none" ;

Set Scroll Position Bottom In Div Css Code Example

Example 1: javascript scroll to bottom of div //scroll to the bottom of "#myDiv" var myDiv = document. getElementById ( "myDiv" ) ; myDiv.scrollTop = myDiv.scrollHeight ; Example 2: set scroll position bottom in div css // scroll to end var scrollDiv = document. getElementById ( "moveToBottom" ) ; scrollDiv.scrollTop = scrollDiv.scrollHeight ;

Absolute Value Vector3 Unity Code Example

Example: unity absolute value Mathf . Abs ( - 10.5f )