Posts

Showing posts from June, 2014

Slick Slider Space Between Slides Code Example

Example 1: slick margin between slides /* the slides */ .slick-slide { margin : 0 26 px ; } /* the parent */ .slick-list { margin : 0 -26 px ; } Example 2: how to make distance betwwen corosel transition /* the slides */ .slick-slide { margin : 0 10 px ; } /* the parent */ .slick-list { margin : 0 -10 px ; }

Create Aar File In Android Studio

Answer : If your library is set up as an Android library (i.e. it uses the apply plugin: 'com.android.library' statement in its build.gradle file), it will output an .aar when it's built. It will show up in the build/outputs/aar/ directory in your module's directory. You can choose the "Android Library" type in File > New Module to create a new Android Library. Retrieve exported .aar file from local builds If you have a module defined as an android library project you'll get .aar files for all build flavors (debug and release by default) in the build/outputs/aar/ directory of that project. your-library-project |- build |- outputs |- aar |- appframework-debug.aar - appframework-release.aar If these files don't exist start a build with gradlew assemble for macOS users ./gradlew assemble Library project details A library project has a build.gradle file containing apply plugin: com.android.

Android Studio Where Is Color Picker For Flutter Plugin

Image
Answer : The color picker is not clickable in Android Studio running Flutter( Dart code), see picture below. But i found a work around using the Color class and manually opening color picker. Then pick a color and copy/paste it like this: Here is how i do it: 1. Double tap shift to run search 2. Type Color or Picker 3. Open Color Picker from the search list 4. Copy/paste the HEX color code into your color class. Expert tip: Add color picker to a keyboard shortcut . You can find the settings for Keymap , under File > Settings > Keymap

Angular Unit Test Error: No Component Factory Found For Component. Did You Add It To @NgModule.entryComponents

Answer : Testing is doubting. More seriously, let me answer you. In Angular, your components are handled by a module. When you use Material dialogs and snackers, you actually use a feature of the CDK, which is called Portal . This allow you to create your components dynamically. But when you do so, you have to add them to the entryComponents of your module. You did it in your module, so you should also do it in your tests. The syntax is TestBed .configureTestingModule(...) .overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [YourComponent] } }); there are two places at which this is supposed to be done....entry components and also at declarations(while configuring your testing module).... TestBed .configureTestingModule({ declarations: [YourComponent], }) .overrideModule(BrowserDynamicTestingModule, { set: { entryComponents: [YourComponent] } }); If someone struggling to find BrowserDynamicTestingModule just use BrowserModule

Cannot Launch AVD In Emulator. Please Ensure Intel HAXM Is Properly Installed And Usable

Answer : After downloading the Intel HAXM from the android studio, you need to install it. Run the setup from Users*name*\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe Sadly, this can be installed only on computers with Intel CPU's, so you must have an Intel to run the Android Studio emulator. Have you tried reinstalling Intel HAXM? To do that follow these steps. 1) Open SDK Manager and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't. 2) Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory Go to extras > intel > Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe". 3) Restart Android Studio and then try to start the AVD again. It might take a minute or 2 to show the emulator window.

Team Fortress Classic System Requirements Code Example

Example 1: team fortress classic Good Ending You Changed To Team Fortress Classic Only Because You Are Done With The Bots Example 2: team fortress classic The bots piss you off so change to classic mode good ending

Transition On Visibility Css 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 ; }

Creating An Associative Array In JavaScript Using The Map Function

Answer : You may use Array.prototype.reduce for your task. It allows a return value in the callback function for the next call. var data = [ { 'list': 'one', 'item': 1 }, { 'list': 'one', 'item': 2 }, { 'list': 'one', 'item': 3 }, { 'list': 'two', 'item': 1 }, { 'list': 'two', 'item': 2 } ], flat = data.reduce(function (r, a) { r[a.list] = r[a.list] || []; r[a.list].push(a.item); return r; }, {}); document.write('<pre>' + JSON.stringify(flat, 0, 4) + '</pre>');

Add A Cron Job Ubuntu Code Example

Example: set cron job in ubuntu Setting Up a Website Backup through Cron :- == == == == == == == == == == == == == == == == == == == == == = Step 1 : Update your server. As a best practice, we will update and upgrade our server with the following command. apt-get update && apt-get upgrade Step 2 : Verify if the cron package is installed. dpkg -l cron a ) Our example output let’s us know that the cron package is installed, along with its version: || / Name Version Architecture Description +++- == == == == == == == == == == == == = - == == == == == == == == = - == == == == == == == == = - == == == == == == == == == == == == == == == == == == == == == == == == == == == == ii cron 3 .0pl1-128ubuntu2 amd64 process scheduling daemon b ) Install cron package if necessary. sudo apt-get install cron c ) Ensure that the cron service is running with the following command: systemctl status cron Example Output: ---------------- * cron.servi

How To Use Malloc To Create Array In C Code Example

Example 1: malloc int array c int array_length = 100 ; int * array = ( int * ) malloc ( array_length * sizeof ( int ) ) ; Example 2: how to dynamically allocate array size in c // declare a pointer variable to point to allocated heap space int * p_array ; double * d_array ; // call malloc to allocate that appropriate number of bytes for the array p_array = ( int * ) malloc ( sizeof ( int ) * 50 ) ; // allocate 50 ints d_array = ( int * ) malloc ( sizeof ( double ) * 100 ) ; // allocate 100 doubles // use [] notation to access array buckets // (THIS IS THE PREFERED WAY TO DO IT) for ( i = 0 ; i < 50 ; i ++ ) { p_array [ i ] = 0 ; } // you can use pointer arithmetic (but in general don't) double * dptr = d_array ; // the value of d_array is equivalent to &(d_array[0]) for ( i = 0 ; i < 50 ; i ++ ) { * dptr = 0 ; dptr ++ ; } Example 3: c malloc array # define ARR_LENGTH 2097152 int * arr = mallo

Convert Unix Time With PowerShell

Answer : See Convert a Unix timestamp to a .NET DateTime . You can easily reproduce this in PowerShell. $origin = New-Object -Type DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0 $whatIWant = $origin.AddSeconds($unixTime) Function Convert-FromUnixDate ($UnixDate) { [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddSeconds($UnixDate)) } $niceTime = Convert-FromUnixDate $ctime PS C:\> $niceTime Friday, 18 May 2012 8:24:18 p.m. $date = get-date "1/1/1970" $date.AddSeconds($unixTime).ToLocalTime()

Set Transition Visibility Css 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 ; }

Rounded Button Plus Icon Css Code Example

Example: round button css .btn { display : block ; height : 300 px ; width : 300 px ; border-radius : 50 % ; border : 1 px solid red ; }

Crontab Day Of The Week Syntax

Answer : 0 and 7 both stand for Sunday, you can use the one you want, so writing 0-6 or 1-7 has the same result. Also, as suggested by @Henrik, it is possible to replace numbers by shortened name of days, such as MON , THU , etc: 0 - Sun Sunday 1 - Mon Monday 2 - Tue Tuesday 3 - Wed Wednesday 4 - Thu Thursday 5 - Fri Friday 6 - Sat Saturday 7 - Sun Sunday Graphically: ┌────────── minute (0 - 59) │ ┌──────── hour (0 - 23) │ │ ┌────── day of month (1 - 31) │ │ │ ┌──── month (1 - 12) │ │ │ │ ┌── day of week (0 - 6 => Sunday - Saturday, or │ │ │ │ │ 1 - 7 => Monday - Sunday) ↓ ↓ ↓ ↓ ↓ * * * * * command to be executed Finally, if you want to specify day by day, you can separate days with commas, for example SUN,MON,THU will exectute the command only on sundays, mondays on thursdays. You can read further details in Wikipedia's article about Cron. :-) Sunday | 0 -> Sun | Mo

CSS :first-letter Not Working

Answer : ::first-letter does not work on inline elements such as a span . ::first-letter works on block elements such as a paragraph, table caption, table cell, list item, or those with their display property set to inline-block . Therefore it's better to apply ::first-letter to a p instead of a span . p::first-letter {font-size: 500px;} or if you want a ::first-letter selector in a span then write it like this: p b span::first-letter {font-size: 500px !important;} span {display:block} MDN provides the rationale for this non-obvious behaviour: The ::first-letter CSS pseudo-element selects the first letter of the first line of a block, if it is not preceded by any other content (such as images or inline tables) on its line. ... A first line has only meaning in a block-container box, therefore the ::first-letter pseudo-element has only an effect on elements with a display value of block , inline-block , table-cell , list-item or table-caption . In all other cases, ::f

Convert A Hex String To Binary And Send With Netcat

Answer : I used the -r and -p switch to xxd : $ echo '0006303030304e43' | xxd -r -p | nc -l localhost 8181 Thanks to inspiration from @Gilles answer, here's a perl version: $ echo '0006303030304e43' | perl -e 'print pack "H*", <STDIN>' | nc -l localhost 8181 Here a solution without xxd or perl : If the echo builtin of your shell supports it ( bash and zsh do, but not dash ), you just need to use the right backslash escapes: echo -ne '\x00\x06\x30\x30\x30\x30\x4e\x43' | nc -l localhost 8181 If you have /bin/echo from GNU coreutils (nearly standard on Linux systems) or from busybox you can use it, too. With sed you can generate a escaped pattern: $ echo '0006303030304e43' | sed -e 's/../\\x&/g' \x00\x06\x30\x30\x30\x30\x4e\x43 Combined: echo -ne "$(echo '0006303030304e43' | sed -e 's/../\\x&/g')" | nc -l localhost 8181 If you have xxd , that's easy: it can convert to and f

50 By 70 Cm In Inches Code Example

Example: cm to inches const cm = 1; console.log(`cm:${cm} = in:${cmToIn(cm)}`); function cmToIn(cm){ var in = cm/2.54; return in; }

Css Transition From Left To Right Code Example

Example: how to use the transition left in css nav :hover { left : 0 ; transition : 2 s ; }

Transform Translate Css Mdn Code Example

Example: css scale transform : scale ( sx , sy ) ;