Posts

Showing posts from March, 2021

Amazon.Runtime.AmazonServiceException: Unable To Find Credentials

Answer : Create a credentials file at any path where you can access this path from web service application e.g. C:\awsfile\credentials but remember don't give any extension this file File should contains following data. [default] aws_access_key_id=[your_access_key] aws_secret_access_key=[your_secret_key] After this you need to set the path in appsetting tag in the Web.config file: <appSettings> <add key="AWSProfilesLocation" value="C:\awsfile\credentials" /> <add key="AWSRegion" value="us-east-1" /> </appSettings> In AWS Explorer for Visual Studio you can create user profiles that give you different permissions on AWS, then you can choose which profile you want to use in AWS Explorer. These profiles are available only to your Windows user account, if anyone else uses your computer then they will have to create their own profiles. Any software that you run under your user account can also use these profiles.

Copy And Paste Content From One File To Another File In Vi

Answer : Since you already know how to cut/yank text, here are a few ideas for pasting it back into another file: Edit the first file, yanking the text you want. Then open your second file from within vi ( :e /path/to/other/file ) and paste it Open both files together in a split window and navigate between them using Ctrl + w , Up / Down either by: vi -o /path/to/file1 /path/to/file2 From within the first file, Ctrl + w , s If you are using Vim on Windows, you can get access to the clipboard (MS copy/paste) using: " * d d -- cut a line (or 3dd to cut three lines) " * y y -- copy a line (or 3yy to copy three lines) " * p -- paste line(s) on line after the cursor " * P -- paste line(s) on line before the cursor The lets you paste between separate Vim windows or between Vim and PC applications (Notepad, Microsoft Word, etc.). Use the variations of d like dd to cut. To write a range of lines to another file you can use: :<n>,<m> w filename Wher

Build Blender Git Commands Code Example

Example: Build Blender git commands cd C:\blender-git git clone git://git.blender.org/blender.git cd blender git submodule update --init --recursive git submodule foreach git checkout master git submodule foreach git pull --rebase origin master

Android - How To Disable STATE_HALF_EXPANDED State Of A Bottom Sheet

Image
Answer : The value of the half expanded ratio must be set to some value between 0 and 1 exclusive , so set this value to some very low number that is certain to be less than your peek height, say "0.0001f". With this value you should not even see the STATE_HALF_EXPANDED state. The states will fluctuate between STATE_EXPANDED and STATE_COLLAPSED . Alternate solution The solution above works and effectively disables the STATE_HALF_EXPANDED state, but it is hackish (IMO) and may break in the future. For instance, what if a reasonable value for the half expanded ratio which is somewhere between the peek height and the full height is enforced? That would be trouble. The requirements as stated by the OP is that the bottom sheet should transition between the peek height and the full height. There is no problem with the peek height, but the OP specifies isFitToContents = false to get to the full height. (I assume that his bottom sheet may be shorter then the available

Android Sha1 Certificate Fingerprint Code Example

Example 1: android developer sha1 fingerprint keytool -list -v \ -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore Example 2: how to get sha 1 in android studio keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

How To Fix From Origin 'http://localhost:4200' Has Been Blocked By CORS Policy: The 'Access-Control-Allow-Origin' Header Has A Code Example

Example 1: origin 'http://localhost:4200' has been blocked by CORS policy 'Content-Type' : 'application/json' , 'Access-Control-Allow-Origin' : '*' , 'Access-Control-Allow-Headers' : 'Content-Type' , 'Access-Control-Allow-Methods' : 'GET,POST,OPTIONS,DELETE,PUT' , 'Authorization' : 'Bearer key' , Example 2: ccess to XMLHttpRequest at 'http://127.0.0.1:5000/ has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. @app . route ( 'your route' , methods = [ 'GET' ] ) def yourMethod ( params ) : response = flask . jsonify ( { 'some' : 'data' } ) response . headers . add ( 'Access-Control-Allow-Origin' , '*' ) return response

Blackstone Castle Minecraft Code Example

Example: types of bastion minecraft hey , are you into modding or something ?

Postgresql Create Role With Login Code Example

Example 1: how to add user to role postgresql CREATE ROLE joe LOGIN INHERIT ; CREATE ROLE admin NOINHERIT ; CREATE ROLE wheel NOINHERIT ; GRANT admin TO joe ; GRANT wheel TO admin ; Example 2: postgresql create user roles CREATE ROLE name [ WITH ADMIN role_name ]

Calculating Angles Between Line Segments (Python) With Math.atan2

Image
Answer : The easiest and most logically way to get at this problem is using the dot-product. Try this code (I've commented practically everything): import math def dot(vA, vB): return vA[0]*vB[0]+vA[1]*vB[1] def ang(lineA, lineB): # Get nicer vector form vA = [(lineA[0][0]-lineA[1][0]), (lineA[0][1]-lineA[1][1])] vB = [(lineB[0][0]-lineB[1][0]), (lineB[0][1]-lineB[1][1])] # Get dot prod dot_prod = dot(vA, vB) # Get magnitudes magA = dot(vA, vA)**0.5 magB = dot(vB, vB)**0.5 # Get cosine value cos_ = dot_prod/magA/magB # Get angle in radians and then convert to degrees angle = math.acos(dot_prod/magB/magA) # Basically doing angle <- angle mod 360 ang_deg = math.degrees(angle)%360 if ang_deg-180>=0: # As in if statement return 360 - ang_deg else: return ang_deg Now try your variations of lineA and lineB and all should give the same answer. An alternative solution using the fo

Digitalwrite Digitalread Arduino Code Example

Example 1: arduino digitalread digitalRead ( pin number ) ; // can also be used to debug with Serial . println ( digialRead ( pin number ) ) ; Example 2: arduino digitalwrite digitalWrite ( pin number , LOW / HIGH )

Build Modal Css Code Example

Example 1: modal pop up html css <button class= "trigger" >Click here to trigger the modal!</button> <div class= "modal" > <div class= "modal-content" > <span class= "close-button" >×</span> <h1>Hello , I am a modal!</h1> </div> </div> Example 2: modal pop up html css var modal = document. querySelector ( ".modal" ) ; var trigger = document. querySelector ( ".trigger" ) ; var closeButton = document. querySelector ( ".close-button" ) ; function toggleModal ( ) { modal.classList. toggle ( "show-modal" ) ; } function windowOnClick ( event ) { if ( event .target === modal ) { toggleModal ( ) ; } } trigger. addEventListener ( "click" , toggleModal ) ; closeButton. addEventListener ( "click" ,

How To Center An Image In Css W3schools Code Example

Example: html center image /* It's better practice to do this in CSS, not HTML. So here is the CSS code! */ img { display : block ; margin-left : auto ; margin-right : auto ; }