Posts

Showing posts from September, 2001

Android Mirror Vector Drawable

Image
Answer : For those who Use ImageView or TextView or EditText Scale works perfectly. Use android:scaleX="-1" //To flip horizontally or android:scaleY="-1" //To flip vertically OR Try android:rotationX="180" // for horizontal android:rotationY="180" // for vertical OR Simply rotation="180" for vertical android:rotation="180" // for vertical Edit: Additional If you want to flip/mirror icons/drawable when changing language RTL/LTR ("Right To Left"/"Left To Right"), there is a nice way of doing so in android vector drawable just check the ckeckbox Enable auto mirroring for RTL layout . => Right Click on drawable folder => New => Vector Asset => Select drawable => check the Checkbox . I am using AndroidStudio 3.0.1 in Windows 10 . well, there is no need to create another vector image, you can do it with one single vector image just make sure you do the following st

Can't Clone Private Repo On Github From SourceTree

Image
Answer : It happens because SourceTree didn't get some private access from Github while authenticating. So the solution is very simple Login into your Github account on any browser From top right corner select SETTINGS Now select DEVELOPER SETTINGS From DEVELOPER SETTINGS select PERSONAL ACCESS TOKEN Now from PERSONAL ACCESS TOKEN select GENERATE TOKEN Fill Note as sourcetree and Check All Scopes from checkbox as show in below screenshots After Click on Generate Token Now Open sourceTree Click on sourceTree preference & Click add Account Select options as shown in below screen shot Enter username as your Github account username and password as Generated Token from Github Click on SAVE now you might see all your repository are visible and can clone too Hope it helps I had same problem. My fix way: Remove user from SourceTree settings (optional, i not sure); Add you account in setting and generate new SSH key (it's a main part of fix);

ASP.NET Core Testing - Get NullReferenceException When Initializing InMemory SQLite Dbcontext In Fixture

Answer : I encountered this problem while trying to do EF Core scaffolding for an Sqlite database. The problem was that I had installed Microsoft.EntityFrameworkCore.Sqlite.Core rather than Microsoft.EntityFrameworkCore.Sqlite . I uninstalled the former package, and ran this command: Install-Package Microsoft.EntityFrameworkCore.Sqlite -Version 3.1.2 Then everything worked. Yup... My bad. I had installed Microsoft.Data.Sqlite.Core version 3.0.0 when I needed version 2.2.6 and I had not installed Microsoft.Data.Sqlite 2.2.6, which I have since installed. It's working now. Also, FYI: both .UseSqlite("Data Source=:memory:") and .UseSqlite("DataSource=:memory:") work. I had similar issue when trying to open Microsoft.Data.Sqlite.SqliteConnection , it was throwing System.NullReferenceException as well. The class which was initializing the connection was in library project referencing: Microsoft.Data.Sqlite - v3.1.2 Microsoft.Data.Sqlite.Core - v3

Ag-Grid Header Styles Not Changing With CSS On Component

Answer : Try using ::ng-deep combinator https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep ::ng-deep .ag-theme-balham .ag-header { background-color: #e0e0e0; } If that does not work, put your css in the global stylesheet and check if the styles are overriden correctly Override the header-cell class instead .ag-theme-balham .ag-header-cell{ background-color: #e0e0e0; } and if you have header-group then .ag-theme-balham .ag-header-cell, .ag-theme-balham .ag-header-group-cell{ background-color: #e0e0e0; }

Youtube Mp3 Downloader Free 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: youtube download mp3 I use https : //github.com/ytdl-org/youtube-dl/ as a Python CLI tool to download videos

Android Studio Login Template Code Example

Example: android studio login page template EditText username = (EditText)findViewById(R.id.editText1); EditText password = (EditText)findViewById(R.id.editText2); public void login(View view){ if(username.getText().toString().equals("admin") && password.getText().toString().equals("admin")){ //correcct password }else{ //wrong password }

3 Oz To Grams Code Example

Example: oz to g 1 ounce (oz) = 28.3495231 grams (g)

Can I Restore A Single Table From A Full Mysql Mysqldump File?

Answer : You can try to use sed in order to extract only the table you want. Let say the name of your table is mytable and the file mysql.dump is the file containing your huge dump: $ sed -n -e '/CREATE TABLE.*`mytable`/,/Table structure for table/p' mysql.dump > mytable.dump This will copy in the file mytable.dump what is located between CREATE TABLE mytable and the next CREATE TABLE corresponding to the next table. You can then adjust the file mytable.dump which contains the structure of the table mytable , and the data (a list of INSERT ). I used a modified version of uloBasEI's sed command. It includes the preceding DROP command, and reads until mysql is done dumping data to your table (UNLOCK). Worked for me (re)importing wp_users to a bunch of Wordpress sites. sed -n -e '/DROP TABLE.*`mytable`/,/UNLOCK TABLES/p' mydump.sql > tabledump.sql This can be done more easily? This is how I did it: Create a temporary database (e.g. restore):

Bootstrap 4 Multiple Fixed-top Navbars

Answer : Yes, it's possible but you have to position the 2nd one accordingly. The height of the Navbar is ~56px. .fixed-top-2 { margin-top: 56px; } body { padding-top: 105px; } <nav class="navbar navbar-toggleable-sm bg-faded navbar-light fixed-top fixed-top-2"> <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbar1"> <span class="navbar-toggler-icon"></span> </button> <a href="/" class="navbar-brand">One</a> <div class="navbar-collapse collapse" id="navbar1"> <ul class="navbar-nav"> .. </ul> </div> </nav> <nav class="navbar navbar-toggleable-sm bg-inverse navbar-inverse fixed-top"> <button class="navbar-toggler navbar-toggler-right" type="

Angular Mater Code Example

Example 1: angular material //To take advantage of Angular Material install it in the terminal $ ng add @angular / material //Choose the options that will be presented to you Example 2: Angular material design /* Answer to: "Angular material design" */ /* Angular Material is a UI component library for Angular JS developers. Angular Material components help in constructing attractive, consistent, and functional web pages and web applications while adhering to modern web design principles like browser portability, device independence, and graceful degradation. Main Website: https://material.angular.io/ Get started here: https://material.angular.io/guide/getting-started For examples on usage of this library go to: https://material.angular.io/components/ */