Posts

Homemade Perlin Noise Unity Code Example

Example 1: perlin noise unity // HOW TO IMPLEMENT A PERLIN NOISE FONCTION TO GET A TERRAIN HEIGHT IN UNITY using UnityEngine ; public static class NoiseCreator { /// scale : The scale of the "perlin noise" view /// heightMultiplier : The maximum height of the terrain /// octaves : Number of iterations (the more there is, the more detailed the terrain will be) /// persistance : The higher it is, the rougher the terrain will be (this value should be between 0 and 1 excluded) /// lacunarity : The higher it is, the more "feature" the terrain will have (should be strictly positive) public static float GetNoiseAt ( int x , int z , float scale , float heightMultiplier , int octaves , float persistance , float lacunarity ) { float PerlinValue = 0f ; float amplitude = 1f ; float frequency = 1f ; for ( int i = 0 ; i < octaves ; i ++ ) { // Get the perlin value at that octave and add it ...

Create Qr Code Png Image Of 200*200 Using Phpqrcode Code Example

Example: create qr code png image of 200*200 using phpqrcode QRlib . php also does support SVG , doesn 't it? https://github.com/t0k4rt/phpqrcode require_once(__DIR__.' / phpqrcode - master / qrlib . php '); echo QRcode::svg(' hello' ) ;

Android Studio 3.1.1 CreateProcess Error=206, The Filename Or Extension Is Too Long

Answer : I guess you are the windows user, there is a file path limit of 8191 in Windows XP and above. http://support.microsoft.com/kb/830473/en-us The simplest way this shorten the file path, like change the project folder into D:\, and refact your project path, and always use ASCII chars for the folder name. UTF-8 chars use 2-3 bytes. or move useless dependency. or change to MAC platform. ;) The reason is at the compile step, there is a command like javac xxxx, combine all dependences's path in one line. For me this worked. Go to Build -> Clean. File -> Invalidate Cache and Restart Or It might be due to network issue. Please check connectivity.

Transition Rotate3d Css Code Example

Example: css rotate animation <img class="image" src="http://i .stack .imgur .com /pC1Tv .jpg " alt="" width="120" height="120" > .image { position : absolute ; top : 50 % ; left : 50 % ; width : 120 px ; height : 120 px ; margin : -60 px 0 0 -60 px ; -webkit-animation : spin 4 s linear infinite ; -moz-animation : spin 4 s linear infinite ; animation : spin 4 s linear infinite ; } @-moz-keyframes spin { 100% { -moz-transform : rotate ( 360 deg ) ; } } @-webkit-keyframes spin { 100% { -webkit-transform : rotate ( 360 deg ) ; } } @keyframes spin { 100% { -webkit-transform : rotate ( 360 deg ) ; transform : rotate ( 360 deg ) ; } }

Convert Date Format Hours Php Code Example

Example 1: php change date format To convert the date-time format PHP provides strtotime() and date() function. We change the date format from one format to another. Change YYYY-MM-DD to DD-MM-YYYY <? php . $currDate = "2020-04-18" ; $changeDate = date ( "d-m-Y" , strtotime ( $currDate ) ) ; echo "Changed date format is: " . $changeDate . " (MM-DD-YYYY)" ; ?> Example 2: change date format php $currDate = "2020-08-25" ; $changeDate = date ( "d-m-Y" , strtotime ( $currDate ) ) ; echo $changedDate ;

Enumerator In Unity Code Example

Example 1: unity enum using UnityEngine ; using System . Collections ; public class EnumScript : MonoBehaviour { enum Direction { North , East , South , West } ; void Start ( ) { Direction myDirection ; myDirection = Direction . North ; } Direction ReverseDirection ( Direction dir ) { if ( dir == Direction . North ) dir = Direction . South ; else if ( dir == Direction . South ) dir = Direction . North ; else if ( dir == Direction . East ) dir = Direction . West ; else if ( dir == Direction . West ) dir = Direction . East ; return dir ; } } Example 2: unity enum private enum State { Idle , Walk , Attack , }

Cannot Ignore .idea/workspace.xml - Keeps Popping Up

Answer : I was facing the same issue, and it drove me up the wall. The issue ended up to be that the .idea folder was ALREADY commited into the repo previously, and so they were being tracked by git regardless of whether you ignored them or not. I would recommend the following, after closing RubyMine/IntelliJ or whatever IDE you are using: mv .idea ../.idea_backup rm .idea # in case you forgot to close your IDE git rm -r .idea git commit -m "Remove .idea from repo" mv ../.idea_backup .idea After than make sure to ignore .idea in your .gitignore Although it is sufficient to ignore it in the repository's .gitignore, I would suggest that you ignore your IDE's dotfiles globally. Otherwise you will have to add it to every .gitgnore for every project you work on. Also, if you collaborate with other people, then its best practice not to pollute the project's .gitignore with private configuation that are not specific to the source-code of the project. I had t...

Can't Uninstall/reinstall NuGet Package

Answer : In your Solution or Project you will find a file called packages.config . Open this file and you will see all the packages that NuGet has installed. The file will look something like this: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Json" version="2.0.3" targetFramework="net45" /> </packages> Simply delete the line of your package and save the file. <?xml version="1.0" encoding="utf-8"?> <packages> </packages> Then run NuGet again and it should install. The JSON.NET NuGet package should just work with a Windows Phone 8.0 project. Adding it in VS2012 NuGet manager pulls in the WP7 version of JSON.NET. (packages\Newtonsoft.Json.4.5.10\lib\sl3-wp\Newtonsoft.Json.dll) JSON.NET is now also available as a Portable Class Library which you can consume from WP8 (available in NuGet or in source form). UPDATE: The latest version of N...

AltGr Randomly Stops Working On Windows 10

Answer : The issue happens when you open a RDP connection. Just bring the RDP window in foreground and press Alt + Enter . The issue will disappear on all other windows too Source: How to Fix Alt Gr Key Not Working. In my case left Shift + Caps Lock + AltGr helped. I have no idea what it does, but it works. Some utility programs can also "steal" the keyboard stroks. In my case it appeared that the VirtualDesktopManager resulted in non-functional AltGr, so I could not write [ and ] .

Can I Check Playtime On PS4 Without PS Plus?

Answer : No There Is no official way for a user to check their playtime statistics. And as for checking RDR2 playtime exclusively Rockstar didnt include the ability to check it unlike their former games (you could check a lot of your in-game stats on their website for GTA-V etc. ). You can enable an email from playstation that will send you your total playtime for the year but you can't check this whenever you want. Sources: 1 2 3 Yes , you can check all stats including playtime on rockstar's social club website. Just login with your platform account.

What Is Class In Oops Code Example

Example: class in oops // DEFINITION /* In object-oriented programming, a class is an extensible program-code-template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods). */

Cron Fivem Download Code Example

Example: fivem cron -- Execute task 5:10, every day function CronTask(d, h, m) print('Task done') end TriggerEvent('cron:runAt', 5, 10, CronTask) -- Execute task every monday at 18:30 function CronTask(d, h, m) if d == 1 then print('Task done') end end TriggerEvent('cron:runAt', 18, 30, CronTask)

Ubuntu 18 Install Nvm Code Example

Example 1: install node js ubuntu sudo apt - get install curl curl - sL https : //deb.nodesource.com/setup_13.x | sudo -E bash - sudo apt - get install nodejs # Check node version node - v # v 13.9 .0 # Also , check the npm version npm - v # 6.13 .7 Example 2: install nvm ubuntu curl - o - https : //raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash export NVM_DIR = "$([ -z " $ { XDG_CONFIG_HOME - } " ] && printf %s " $ { HOME } / . nvm " || printf %s " $ { XDG_CONFIG_HOME } / nvm ")" [ - s "$NVM_DIR/nvm.sh" ] && \ . "$NVM_DIR/nvm.sh" # This loads nvm . Now you can use nvm Example 3: ubuntu 18 install nodejs cd ~ curl - sL https : //deb.nodesource.com/setup_12.x -o nodesource_setup.sh sudo bash nodesource_setup . sh sudo apt install nodejs nodejs - v # shows your version

Add A PDF Viewer To A WPF Application

Answer : As already suggested by @NawedNabiZada, one tried and straightforward way is to use embedded InternetExplorer to show Adobe PDF Reader ActiveX control. So it assumes you are running on Windows and have Adobe PDF Reader installed. Then you create a user control, window etc. that contains following control: <WebBrowser x:Name="pdfWebViewer"></WebBrowser> In the constructor navigate to blank page: pdfWebViewer.Navigate(new Uri("about:blank")); To load a PDF document to that control use this simple code: pdfWebViewer.Navigate(fullPathToPDF); This approach is used by many Windows software not only WPF apps including SAP client, but has a hidden problem, see this question. The Adobe PDF Reader Addon in Internet Explorer must be enabled for this to work. There are various problems with Acrobat Reader XI, better to use DC version. To enable Adobe PDF go to IE settings, add-ons and find Adobe PDF Reader and enable it (AR XI and above...

Error: Expected Declaration Or Statement At End Of Input } In C Code Example

Example: error: expected declaration or statement at end of input /*Normally that error occurs when a } was missed somewhere in the code*/

All Ascii Characters Copy Paste Code Example

Example: every ascii character copy var s = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';