Posts

Showing posts from November, 2009

Change Text Color In Div Css Code Example

Example 1: css change text color p { color : White ; } Example 2: changong text color css color : # EAF6F6 ; color : red ; color : rgb ( 255 , 255 , 255 ) ;

Attempted Import Error: 'Icon' Is Not Exported From 'antd'

Answer : On upgrading the version of Ant Design to v4, one of the major breaking changes have been that Icon is no longer exported from antd package. Also instead of having string based icon references like: // Before <Icon type="smile" /> In v4: import { SmileOutlined } from '@ant-design/icons'; <SmileOutlined /> There is still an Icon export, but that is from the package @ant-design/icons instead of just antd . This Icon export can be used for adding custom icons. Docs Changelog In v4, the icons are a default export, so do import Icon from '@ant-design/icons'; instead of import {Icon} from 'antd'; You might also need to do npm install @ant-design/icons --save-dev Your import is wrong. Check ant documentation: https://ant.design/components/icon/ Are you using v4? import Icon from '@ant-design/icons';

Youtube To Mp3 Con 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: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3 Example 3: youtube download mp3 I use https : //github.com/ytdl-org/youtube-dl/ as a Python CLI tool to download videos

Android Studio 32 Bit Code Example

Example: install android studio java --version sudo apt install openjdk-11-jdk sudo add-apt-repository ppa:maarten-fonville/android-studio sudo apt update sudo apt install android-studio

AmazonS3Client(credentials) Is Deprecated

Answer : You can either use AmazonS3ClientBuilder or AwsClientBuilder as alternatives. For S3, simplest would be with AmazonS3ClientBuilder, BasicAWSCredentials creds = new BasicAWSCredentials("access_key", "secret_key"); AmazonS3 s3Client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(creds)).build(); Use the code listed below to create an S3 client without credentials: AmazonS3 s3Client = AmazonS3ClientBuilder.standard().build(); An usage example would be a lambda function calling S3. You need to pass the region information through the com.amazonaws.regions.Region object. Use AmazonS3Client(credentials, Region.getRegion(Regions.REPLACE_WITH_YOUR_REGION))

Apple - Can't Remove "Install MacOS High Sierra.app"

Answer : I was experiencing this problem after downloading High Sierra to fix a friend's Mac. I found Rick's solution worked for me, but I've added a few more steps. Click the  symbol in the Menu bar. Click Restart…. Hold down Command + R to boot into Recovery Mode. Click Utilities. Select Terminal. Type csrutil disable . This will disable SIP. Press Return or Enter on your keyboard. Click the  symbol in the Menu bar. Click Restart…. Extra Steps Log in / boot up the Mac. Empty Trash. I also found that somehow Previous System folder appeared under the Mac HD. So I also trashed that (which wouldn't trash previously). I then rebooted the Mac a few times to check that everything was working fine. Then rebooted into recovery mode. Hold down Command + R to reboot into Recovery Mode. Click Utilities. Select Terminal. Type csrutil enable . This will enable SIP. Press Return or Enter on your keyboard. Click the  symbol in the Menu bar. C

C++ Multiline String Literal

Answer : Well ... Sort of. The easiest is to just use the fact that adjacent string literals are concatenated by the compiler: const char *text = "This text is pretty long, but will be " "concatenated into just a single string. " "The disadvantage is that you have to quote " "each part, and newlines must be literal as " "usual."; The indentation doesn't matter, since it's not inside the quotes. You can also do this, as long as you take care to escape the embedded newline. Failure to do so, like my first answer did, will not compile: const char *text2 = "Here, on the other hand, I've gone crazy \ and really let the literal span several lines, \ without bothering with quoting each line's \ content. This works, but you can't indent."; Again, note those backslashes at the end of each line, they must be immediately before the line ends, they are escaping the newline in the source, so tha

Automatizing PSfrag Export

Image
Answer : Let me try to give you some hints. Problem 1. When you look at a specific tick in a Graphics it usually looks similar to the following {200., 200., {0.00625, 0.}, {GrayLevel[0.], AbsoluteThickness[0.25]}} it means, at position 200 draw the number 200. The next list is the specification of the tick-length and then follows a list of graphic-directives to use. I assume if you convert the label into another form, like a string, you may have more luck with your approach. Let's try something transformTick[{pos_, label_, length_List, spec_List}] := {pos, ToString[label, TraditionalForm], length, spec} p1 = Plot[x^2, {x, 0, 1000}, Frame -> True] p2 = Show[p1, FrameTicks -> Map[transformTick, FrameTicks /. AbsoluteOptions[p, FrameTicks], {2}]] It seems the Ticks are a bit smaller and the dot after the number does not appear in the original but otherwise it looks OK for me. If you now compare ImportString[ExportString[#, "EPS"], "EPS&qu

Android Display Splash-Screen While Loading

Answer : You should not be creating a new thread on startup, instead you should create a view that does not have to wait for your resources to load, as detailed in this article: Splash Screens the Right Way. As stated in the article, you should create a layer-list drawable instead of a layout XML file: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Fill the background with a solid color --> <item android:drawable="@color/gray"/> <!-- Place your bitmap in the center --> <item> <bitmap android:gravity="center" android:src="@mipmap/ic_launcher"/> </item> </layer-list> Then create a theme using the drawable file as a background. I use the background attribute instead of the windowBackground attribute as suggested in the article, because background takes the status and navigation bars into account, centerin

Cap Aborted! SSHKit::Runner::ExecuteError: Exception While Executing On Host

Answer : Just write the command in console: ssh-add If that don't work, write below command in console: ssh-add ~/.ssh/id_rsa and then re-run the command (i.e. cap production deploy ), It will work for sure. Capistrano wasn't able to create the folder on ec2. Once I created the folder it worked like a charm. So if you also have similar issues try creating the folder on ec2 and then execute the cap production deploy. So what are the permissions for /var/www/my_app in your remote machine ? Make sure they are owned by the same user that you specified in this config option: set :user, "mydeployuser" If not I believe Capistrano defaults to the user you are using to run the 'cap' command on the client machine. Make sure that it has permissions to modify/create /var/www/my_app Since you have: set :use_sudo, true it's possible that sudo may not be setup as passwordless sudo like suggested in the Cap 3 docs

Area Of A Beacon Minecraft Code Example

Example 1: beacon radius minecraft Minecraft Beacon Range: Level 1 = 20 Blocks (Needs 9 blocks) - Bonus: Speed/Haste Level 2 = 30 Blocks (Needs 34 blocks) - Bonus: Jump Boost/Resistance Level 3 = 40 Blocks (Needs 83 blocks) - Bonus: Strength Level 4 = 50 Blocks (Needs 164 Blocks) - Bonus: Regeneration II/ Other Boost II You're welcome ^^ Example 2: full beacon size who ever typed the answer in grepper answer is a legend

Are The Birds In Minecraft Chickens Or Ducks?

Image
Answer : They are chickens. This can be verified in the source code, where the sounds they make are all identified as mob.chicken and the skin texture is chicken.png . Additionally, you can see their wattles in-game, which ducks do not have. It has been mentioned that, in a recent blog post, Notch himself expressed some confusion over their species. As he is the one who created them, however, this is likely an in-joke for the community — he has a history of such humor, like the patch note for removing Herobrine. Update: Notch tweeted today that "the chicken is now a duck". It's unclear whether this is a change in direction… or more trolling. As pictured in the question, creature has a red piece of body unterneath beak. It's quite similar in placement and color to an organ named the wattle which distinguishes Chickens (Gallus Gallus Domesticus) from Ducks (Anatidae). I think that they are chickens because in the minecraft wiki, it says that they are chi

Beacon Crafting Recipe Code Example

Example 1: blocks for beacon to make a full powered beacon you need 164 blocks of any type of goodie Example 2: how many iron blocks for a full beacon You need 81 iron blocks for a full beacon Example 3: how to use beacon power in minecraft in java edition /give @p beacon 1

Allow 2 Decimal Places In

Answer : Instead of step="any" , which allows for any number of decimal places, use step=".01" , which allows up to two decimal places. More details in the spec: https://www.w3.org/TR/html/sec-forms.html#the-step-attribute If case anyone is looking for a regex that allows only numbers with an optional 2 decimal places ^\d*(\.\d{0,2})?$ For an example, I have found solution below to be fairly reliable HTML: <input name="my_field" pattern="^\d*(\.\d{0,2})?$" /> JS / JQuery: $(document).on('keydown', 'input[pattern]', function(e){ var input = $(this); var oldVal = input.val(); var regex = new RegExp(input.attr('pattern'), 'g'); setTimeout(function(){ var newVal = input.val(); if(!regex.test(newVal)){ input.val(oldVal); } }, 0); }); Update setTimeout is not working correctly anymore for this, maybe browsers have changed. Some other async solution will need to be devised

Clear Date Formatting Php Code Example

Example 1: php format date <?php // Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the // Mountain Standard Time (MST) Time Zone // $today = date ( "F j, Y, g:i a" ) ; // March 10, 2001, 5:16 pm $today = date ( "m.d.y" ) ; // 03.10.01 $today = date ( "j, n, Y" ) ; // 10, 3, 2001 $today = date ( "Ymd" ) ; // 20010310 $today = date ( 'h-i-s, j-m-y, it is w Day' ) ; // 05-16-18, 10-03-01, 1631 1618 6 Satpm01 $today = date ( '\i\t \i\s \t\h\e jS \d\a\y.' ) ; // it is the 10th day. $today = date ( "D M j G:i:s T Y" ) ; // Sat Mar 10 17:16:18 MST 2001 $today = date ( 'H:m:s \m \i\s\ \m\o\n\t\h' ) ; // 17:03:18 m is month $today = date ( "H:i:s" ) ; // 17:16:18 $today = date ( "Y-m-d H:i:s" ) ;

Add Int To String Arduino Code Example

Example: int to string arduino String stringOne = "Hello String"; // using a constant String String stringOne = String('a'); // converting a constant char into a String String stringTwo = String("This is a string"); // converting a constant string into a String object String stringOne = String(stringTwo + " with more"); // concatenating two strings String stringOne = String(13); // using a constant integer String stringOne = String(analogRead(0), DEC); // using an int and a base String stringOne = String(45, HEX); // using an int and a base (hexadecimal) String stringOne = String(255, BIN); // using an int and a base (binary) String stringOne = String(millis(), DEC); // using a long and a base String stringOne = String(5.698, 3); // using a float and the decimal places

Cannot Open Source File Iostream Visual Studio Code Example

Example: cannot open source file "iostream" //include paths gcc -v -E -x c++ -

Admob Account Suspended Due To "invalid Activity On The AdSense Ads Hosted On Your Website"

Answer : From googles support pages: Invalid click activity consists of any clicks or impressions that may artificially inflate an advertiser's costs or a publisher's earnings, and for which we decide not to charge the advertiser. This includes, but is not limited to, clicks or impressions generated by a publisher clicking his own ads, a publisher encouraging clicks on his ads, automated clicking tools or traffic sources, robots or other deceptive software. Basically, they want genuine user interest. Most of the generated revenue from your app may have been from one person (intentional or not) which has lead them to believe that the clicks were fake. Google uses very sophisticated Artificial Intelligence program to track user mouse pointer location on the page and using the mouse pointer behavior it decides whether it’s a legit or fake click. Sometimes the app or website owner will click the links themselves. This 30 day ban is a cooling off period. Some common ca

37 Inch To Cm Code Example

Example: inch to cm 1 inch = 2.54 cm

6 Feet 5 Inches In Cm Code Example

Example: 6 foot 5 to cm 6foot 5inches is 195,58 cm

Bootstrap 4 Jquery Modal Show Code Example

Example 1: bootstrap modals < div class = "modal" tabindex = "-1" role = "dialog" > < div class = "modal-dialog" role = "document" > < div class = "modal-content" > < div class = "modal-header" > < h5 class = "modal-title" > Modal title < / h5 > < button type = "button" class = "close" data - dismiss = "modal" aria - label = "Close" > < span aria - hidden = "true" > × < / span > < / button > < / div > < div class = "modal-body" > < p > Modal body text goes here . < / p > < / div > < div class = "modal-footer" > < button type = "button" class = "btn btn-primary" > Save changes < / button > <

Apps Aren't Loaded Yet. With Signals

Answer : In django 1.9 # it is not need edit __init__.py apps.py from django.apps import AppConfig class YourAppConfig(AppConfig): name = 'your_app_name' verbose_name = 'Your App Name' # optional def ready(self): from your.app.path import signals # import your signals.py settings.py # include path to YourAppConfig class: INSTALLED_APPS = [ 'your_app.apps.YourAppConfig', # ..., ] see django docs Try registering signals when the app first loads. In you __init.py__ file: default_app_config = 'yourappname.apps.YourAppConfig' In apps.py of the app: from django.apps import AppConfig class YourAppConfig(AppConfig): name = 'yourappname' def ready(self): from yourappname import signals Do this for every app involved in registering signals. Read this for more info. There are several things to try: remove "from django.contrib.auth import get_user_model" has you do