Posts

Showing posts from September, 2007

Add Ripple Effect To My Button With Button Background Color?

Answer : Here is another drawable xml for those who want to add all together gradient background, corner radius and ripple effect: <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/colorPrimaryDark"> <item android:id="@android:id/mask"> <shape android:shape="rectangle"> <solid android:color="@color/colorPrimaryDark" /> <corners android:radius="@dimen/button_radius_large" /> </shape> </item> <item android:id="@android:id/background"> <shape android:shape="rectangle"> <gradient android:angle="90" android:endColor="@color/colorPrimaryLight" android:startColor="@color/colorPrimary"

Math Pow C Library Code Example

Example 1: pow() c int base = 3 ; int power = 5 ; pow ( double ( base ) , double ( power ) ) ; Example 2: pow() c [ Mathematics ] xy = pow ( x , y ) [ In programming ]

Deagle Printstream Code Example

Example: printstream deagle Stop wasting your money on CSGO skins : )

Android Bitmap Image Size In XML

Answer : Only API 23 or later Just use <item android:width="200dp" android:height="200dp" android:drawable="@drawable/splash_background" android:gravity="center" /> instead <item android:left="200dp" android:right="200dp"> <bitmap android:src="@drawable/splash_background" android:gravity="center" /> </item> Although there is no width and height parameters for bitmap, you can set bitmap size using gravity and item width/height. <item android:width="230dp" android:height="70dp"> <bitmap android:gravity="fill_horizontal|fill_vertical" android:src="@drawable/screen" /> </item> You can set item width and height and scale bitmap inside of it using gravity. I know this is old question but maybe someone will find it useful. WARNING: As already

Changing The UINavigationBar Background Image

Answer : Starting in iOS 5 you should use the -setBackgroundImage:forBarMetrics: method: [myNavbar setBackgroundImage:[UIImage imageNamed: @"UINavigationBarBackground.png"] forBarMetrics:UIBarMetricsDefault]; And in Swift 4 : navigationBar.setBackgroundImage(UIImage(named: "UINavigationBarBackground.png"), for: .default) Considering all iOS versions, this seems to be accomplishing both Custom background image and Custom size of UINavigationBar: @interface CustomNavigationBar : UINavigationBar @end @implementation CustomNavigationBar -(void) drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"navigationBar"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; //for iOS5 [self setBackgroundImage:[UIImage imageNamed: @"navigationBar"] forBarMetrics:UIBarMetricsDefault]; } //for custom size of the UINavigationBar - (CGSize)sizeThatFits:(CGSize

Index Dataframe By Row Number Code Example

Example: pandas df by row index indices = [ 133 , 22 , 19 , 203 , 14 , 1 ] df_by_indices = df . iloc [ indices , : ]

Examples Of Runtime Errors In C++

Example: runtime error in c++ Runtime errors indicate bugs in the program or problems that the designers had anticipated but could do nothing about .

Bs4 Python Example

Example 1: use beautifulsoup #start from bs4 import BeautifulSoup import requests req = requests.get ( 'https://www.slickcharts.com/sp500' ) soup = BeautifulSoup ( req.text, 'html.parser' ) Example 2: beautiful soup 4 from bs4 import BeautifulSoup with open ( "index.html" ) as fp: soup = BeautifulSoup ( fp ) soup = BeautifulSoup ( "<html>a web page</html>" )

Bootstrap 4 Table Template Code Example

Example 1: table bootstrap 4 # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Example 2: div table bootstrap 4 # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter # First Last Handle 1 Mark Otto @mdo 2 Jacob Thornton @fat 3 Larry the Bird @twitter Example 3: bootstrap table # First Last Handle 1 Mark Otto @mdo 2 Jacob Th

All Real Numbers Latex Code Example

Example: latex real number symbol \documentclass{article} \usepackage{amssymb} \begin{document} \begin{tabular}{ll} Plain-\TeX{}: & ${\rm I\!R}$\\ amssymb: & $\mathbb{R}$ \end{tabular} \end{document}

Bootstrap Tutorial W3schools Code Example

Example: bootstrap Navbar Home (current) Link Dropdown Action Another action Something else here Disabled Search

Bottom Navigation With Center Home Button Flutter Code Example

Example: change bottom navigation bar from button flutter Having such functionality can decrease your thinking capabilities. If you still want to here is the link you can check out. https://medium.com/@theboringdeveloper/common-bottom-navigation-bar-flutter-e3693305d2d

Check If File Exists In S3 Using Ls And Wildcard

Answer : (re-drafted from comment as it appears this answered the question) I myself tried, and failed to use wildcards in the aws-cli, and according to the docs, this is not currently supported. Simplest (though least efficient) solution would be to use grep: aws s3 ls s3://my-bucket/folder/ | grep myfile Alternatively, you could write a short python/other script to do this more efficiently (but not in a single command) aws s3 ls does not support globs, but sync does and has a dry run mode. So if you do this (from an empty directory) you should get the results you want: aws s3 sync s3://my-bucket . --exclude "*" --include "folder/*myfile*" --dryrun It will produce lines like this for matching files: (dryrun) download s3://my-bucket/folder/myfile.txt to folder/myfile.txt (dryrun) download s3://my-bucket/folder/_myfile-foo.xml to folder/_myfile-foo.xml S3 doesn't support wildcard listing. You need to list all the files and grep it. aws s3 ls s3:

Clg Code Example

Example: clg console.log("CLG is a shortcut for console log");