Tutorial by Examples: e

R has a set of built in higher order functions: Map, Reduce, Filter, Find, Position, Negate. Map applies a given function to a list of values: words <- list("this", "is", "an", "example") Map(toupper, words) Reduce successively applies a binary functi...
If the file already exists, it will be overwritten! String fileName = "file.zip"; // name of the file String urlToGetFrom = "http://www.mywebsite.com/"; // URL to get it from String pathToSaveTo = "C:\\Users\\user\\"; // where to put it ...
The objects created within a Tiled Map (.tmx), can be simply loaded as bodies into a Box2D world using the Libgdx MapObject class as following: public void buildBuildingsBodies(TiledMap tiledMap, World world, String layer){ MapObjects objects = tiledMap.getLayers().get(layer).getObjects(); ...
Query SELECT st.name, st.percentage, CASE WHEN st.percentage >= 35 THEN 'Pass' ELSE 'Fail' END AS `Remark` FROM student AS st ; Result +--------------------------------+ | name | percentage | Remark | +--------------------------------+ | Isha | 67 | Pas...
class Tutorial extends Game { public ScreenNumberOne screenNumberOne; public void create(){ screenNumberOne = new ScreenNumberOne(this); this.setScreen(screenNumberOne); } public void render() { super.render(); } } That is the basic...
There are a couple of builtin viewports, that each do different things. Here is a list of the names, and their descriptions: Viewport NameDescriptionStretchViewportWill stretch the screen. No black bars, but aspect ratio might be off.FitViewportWill maximize it's size based on the aspect ratio. Cou...
You can make your very own custom viewport. It may have black bars, and it may or may not keep it's aspect ratio, depending on how you program it. A custom viewport would look something like this: public class Tutorial extends Viewport. You would need to override update(width, height), but that's it...
<script type="text/javascript" src="URL" async></script>
The <progress> element is new in HTML5 and is used to represent the progress of a task <progress value="22" max="100"></progress> This creates a bar filled 22%
Progress bars can be styled with the progress[value] selector. This example gives a progress bar a width of 250px and a height of 20px progress[value] { width: 250px; height: 20px; } Progress bars can be especially difficult to style. Chrome / Safari / Opera These browsers use the -web...
In Internet Explorer 10+ and Edge, Microsoft provides the -ms-high-contrast media selector to expose the "High Contrast" setting from the browser, which allows the programmer to adjust their site's styles accordingly. The -ms-high-contrast selector has 3 states: active, black-on-white, ...
sqoop import \ --connect <rdbms-jdbc-url> \ --username <username> \ --password <password> \ --table <table-name> Example with Mysql: sqoop import \ --connect jdbc:mysql://mysql.example.com/testdb \ --username root \ --password root \ --table employees CSV file ...
Using --where tag sqoop import \ --connect <rdbms-jdbc-url> \ --username <username> \ --password <password> \ --table <table-name> \ --where "<condition>" Example with Mysql: sqoop import \ --connect jdbc:mysql://mysql.example.com/testdb \ --userna...
In this example you will learn how to generate RSA-OAEP key pair and how to convert private key from this key pair to base64 so you can use it with OpenSSL etc. Please note that this process can also be used for public key you just have to use prefix and suffix below: -----BEGIN PUBLIC KEY----- --...
So, have you ever wondered how to use your PEM RSA key pair that was generated by OpenSSL in Web Cryptography API? If the answers is yes. Great! You are going to find out. NOTE: This process can also be used for public key, you only need to change prefix and suffix to: -----BEGIN PUBLIC KEY----- ...
In the light of the latest httpoxy vulnerabilities, there is another variable, that is widely misused. HTTP_X_FORWARDED_FOR is often used to detect the client IP address, but without any additional checks, this can lead to security issues, especially when this IP is later used for authentication or...
Suppose you want to prevent unauthorized users to access the page then you have to put barrier to them by authorizing access. We can do this by using spring-security which provides basic authentication by securing all HTTP end points. For that you need to add spring-security dependency to your proje...
As from version 5.4, PHP comes with built-in server. It can be used to run application without need to install other http server like nginx or apache. Built-in server is designed only in controller environment for development and testing purposes. It can be run with command php -S : To test it cr...
C99 Since C99, C has variable length arrays, VLA, that model arrays with bounds that are only known at initialization time. While you have to be careful not to allocate too large VLA (they might smash your stack), using pointers to VLA and using them in sizeof expressions is fine. double sumAll(si...
There is a limit to the depth of possible recursion, which depends on the Python implementation. When the limit is reached, a RuntimeError exception is raised: RuntimeError: Maximum Recursion Depth Exceeded Here's a sample of a program that would cause this error: def cursing(depth): try: ...

Page 613 of 1191