This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Represents the velocity. | |
* | |
* To construct a velocity use either the extension function toVelocity, or the extension properties mph, metersPerSecond, and so on, | |
* avaiable on [Int], [Long], [Float] and [Double] numeric types. | |
* | |
* To get the value of this duration expressed in a particular duration units use the properties [inMetersPerSecond] and so on. | |
* | |
* @author Andrei Buneyeu | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
import java.net.UnknownHostException; | |
import java.security.KeyManagementException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.net.ssl.SSLContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends Activity implements BeaconConsumer { | |
protected static final String TAG = "RangingActivity"; | |
BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Cocos2d-x 3.2 | |
When user clicks "close" button or presses Cmd+Q, this code snippet shows a message asking user to confirm the game exit. | |
Particular this code is used on mac desktop versions, but I guess the glfwSetWindowCloseCallback can be used on other desktop platforms too. | |
Things can be changed on later versions of cocos2d-x. | |
*/ |