Posts

Showing posts from April, 2008

Camera Movement Script Unity Code Example

Example 1: unity camera movement script using UnityEngine ; public class CameraController : MonoBehaviour { private float moveSpeed = 0.5f ; private float scrollSpeed = 10f ; void Update ( ) { if ( Input . GetAxisRaw ( "Horizontal" ) != 0 || Input . GetAxisRaw ( "Vertical" ) != 0 ) { transform . position += moveSpeed * new Vector3 ( Input . GetAxisRaw ( "Horizontal" ) , 0 , Input . GetAxisRaw ( "Vertical" ) ) ; } if ( Input . GetAxis ( "Mouse ScrollWheel" ) != 0 ) { transform . position += scrollSpeed * new Vector3 ( 0 , - Input . GetAxis ( "Mouse ScrollWheel" ) , 0 ) ; } } } Example 2: how to code a move camera in unity void Update ( ) { if ( Input . GetKey ( KeyCode . RightArrow ) ) { transform . Translate ( new Vector3 ( speed * Time . deltaTime , 0 , 0 ) ) ; } if ( Input . GetKey (

Discord Hidden Text Code Example

Example 1: how to mark part of your sentence as spoiler in discord put || around your text like this : || example || Example 2: hidden message discord || helo || < -- this is a hidden message you welcome ; ) Example 3: how to mark part of your sentence as spoiler in discord Thank you Curious cardinal

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

Open Local Pdf File In Webview Android Code Example

Example: read pdf web on android webView . loadUrl ( "https://docs.google.com/viewer?url=" + "url of pdf file" ) ;

Android Fragment Life Cycle Code Example

Example: fragment lifecycle onAttach()The fragment instance is associated with an activity instance.The fragment and the activity is not fully initialized. Typically you get in this method a reference to the activity which uses the fragment for further initialization work. onCreate() The system calls this method when creating the fragment. You should initialize essential components of the fragment that you want to retain when the fragment is paused or stopped, then resumed. onCreateView() The system calls this callback when it's time for the fragment to draw its user interface for the first time. To draw a UI for your fragment, you must return a View component from this method that is the root of your fragment's layout. You can return null if the fragment does not provide a UI. onActivityCreated()The onActivityCreated() is called after the onCreateView() method when the host activity is created. Activity and fragment instance have been created as well as the view hierarc

Create Nodemon Github Code Example

Example 1: install nodemon npm install nodemon --save-dev Example 2: nodemon node npm install -g nodemon

Iframe Style Border None Code Example

Example: html iframe no border <iframe src= "myURL" width= "300" height= "300" frameBorder= "0" >Browser not compatible.</iframe>

Coparing Strings Java Code Example

Example 1: java how to compare strings System.out.println("hey".equals("hey")); //prints true /* always use .equals() instead of ==, because == does the compare the string content but loosely where the string is stored in. */ Example 2: Java compare two strings // compare two strings in java .equals() method public class EqualOperatorDemo { public static void main(String[] args) { String str1 = new String("helloworld"); String str2 = new String("helloworld"); System.out.println(str1 == str2); System.out.println(str1.equals(str2)); } }
Answer : Two errors here: first, you're trying to declare arrays[63] for storing 64 elements, as you've probably confused the size of array ( n ) with the maximum possible index value (that's n - 1 ). So it definitely should be litera[64] and liczba[64] . BTW, you have to change this line too - while (i<=64) : otherwise you end up trying to access 65th element. And second, you're trying to fill char value with %s format specifier for scanf, while you should have used %c here. Also, can't help wondering why you declare liczba array as one that stores int s, that initialize it with array of char s. All these '1', '2', etc... literals represent NOT the corresponding digits - but the charcodes for them. I doubt that was your intent.

Convert From P7B To PEM Via OpenSSL

Answer : Solution 1: Try this: $ openssl pkcs7 -inform der -in a.p7b -out a.cer If it doesn't work, brings to a Windows machine and export follow this guide. Solution 2: So to combine the above answers, the command is: openssl pkcs7 -in cert.p7b -inform DER -print_certs -out cert.pem Verified to be working on Windows, using OpenSSL-Win64 /Thanks Bogdan for spotting the error Solution 3: I followed this guide that instructs you to change the header/footer lines from -----BEGIN PKCS #7 SIGNED DATA----- [data] -----END PKCS #7 SIGNED DATA----- to -----BEGIN CERTIFICATE----- [data] -----END CERTIFICATE----- Then run the command openssl pkcs7 -in foo.modified.crt -print_certs -out foo.certs (where foo.modified.crt is the file that you saved the modified version into). This gave me the same results as running through a Windows certificate export as suggested in other answers. Solution 4: As far as I know, the following should convert a pkcs7 cert to a pem openssl pkcs7 -in certific

Creating A UUID From A String With No Dashes

Answer : tl;dr java.util.UUID.fromString( "5231b533ba17478798a3f2df37de2aD7" .replaceFirst( "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5" ) ).toString() 5231b533-ba17-4787-98a3-f2df37de2ad7 Or parse each half of the hexadecimal string as long integer numbers, and pass to constructor of UUID . UUID uuid = new UUID ( long1 , long2 ) ; Bits, Not Text A UUID is a 128-bit value. A UUID is not actually made up of letters and digits, it is made up of bits. You can think of it as describing a very, very large number. We could display those bits as a one hundred and twenty eight 0 & 1 characters. 0111 0100 1101 0010 0101 0001 0101 0110 0110 0000 1110 0110 0100 0100 0100 1100 1010 0001 0111 0111 1010 1001 0110 1110 0110 0111 1110 1100 1111 1100 0101 1111 Humans do not easily read bits, so for convenience we usually represent the 128-bit value as a hexadecimal string made up

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))

How To Install Bootstrap Min Css In Reactjs Code Example

Example 1: react import bootstrap css { /* The following line can be included in your src/index.js or App.js file*/ } import 'bootstrap/dist/css/bootstrap.min.css' ; Example 2: how to install bootstrap in react import 'bootstrap/dist/css/bootstrap.css' ; // Put any other imports below so that CSS from your// components takes precedence over default styles.Copy