Tutorial by Examples: ect

@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToMany @JoinTable(name="FOO_BAR", joinColumns = @JoinColumn(name="fooId"), inverseJoinColumns = @JoinColumn(name="barId", unique=true)) private ...
@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToOne private Bar bar; } @Entity @Table(name="BAR") public class Bar { private UUID barId; //No corresponding mapping to Foo.class } Specifies a one-way relationship b...
Generic redirect to https: # Enable Rewrite engine RewriteEngine on # Check if URL does not contain https RewriteCond %{HTTPS} off [NC] # If condition is true, redirect to https RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L] Generic redirect to http: # Enable Rewrite engine Rewr...
Creating a chart that displays a static dataset is relatively simple. For example, if we have this array of objects as the data: var data = [ {title: "A", value: 53}, {title: "B", value: 12}, {title: "C", value: 91}, {title: "D", value: 24...
Below are some tips to remember while we are writing a select query in MySQL that can help us and reduce our query time:- Whenever we use where in a large table we should make sure the column in where clause are index or not. Ex:- Select * from employee where user_id > 2000. user_id if ind...
public interface ILogger { void Log(string message); } [Export(typeof(ILogger))] [ExportMetadata("Name", "Console")] public class ConsoleLogger:ILogger { public void Log(string message) { Console.WriteLine(message); } } [Export(typeof(IL...
For null check in method Object nullableObject = methodReturnObject(); if (Objects.isNull(nullableObject)) { return; } For not null check in method Object nullableObject = methodReturnObject(); if (Objects.nonNull(nullableObject)) { return; }
In the old fashion way for collection null check List<Object> someObjects = methodGetList(); for (Object obj : someObjects) { if (obj == null) { continue; } doSomething(obj); } With the Objects.nonNull method and Java8 Stream API, we can do the above in this way: ...
GET your REST data and store in a PowerShell object: $Post = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/posts/1" Modify your data: $Post.title = "New Title" PUT the REST data back $Json = $Post | ConvertTo-Json Invoke-RestMethod -Method Put -Uri "h...
GET your REST data and store in a PowerShell object: $Users = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/users" Modify many items in your data: $Users[0].name = "John Smith" $Users[0].email = "[email protected]" $Users[1].name = "Jane S...
As mentioned in the Intro to Expressions expressions are a specific type of object in Julia. As such, they have fields. The two most used fields of an expression are its head and its args. For instance, consider the expression MyExpr3 = Expr(:(=), :x, 2) discussed in Creating Expressions. We...
A user is looking to use caffe for CNN training and testing. The user decides upon the CNN architecture design (e.g - No. of layers, No. of filters and their details etc). The user also decides the optimization technique for training and learning parameters in case training is to be carried out...
import scala.reflect.runtime.universe._ val mirror = runtimeMirror(getClass.getClassLoader) val module = mirror.staticModule("org.data.TempClass")
If the SQL statement is constructed like this: SQL = "SELECT * FROM Users WHERE username = '" + user + "' AND password ='" + pw + "'"; db.execute(SQL); Then a hacker could retrieve your data by giving a password like pw' or '1'='1; the resulting SQL statement will ...
Items are added to a Collection by calling its .Add method: Syntax: .Add(item, [key], [before, after]) ParameterDescriptionitemThe item to store in the Collection. This can be essentially any value that a variable can be assigned to, including primitive types, arrays, objects, and Nothing.keyO...
Items are removed from a Collection by calling its .Remove method: Syntax: .Remove(index) ParameterDescriptionindexThe item to remove from the Collection. If the value passed is a numeric type or Variant with a numeric sub-type, it will be interpreted as a numeric index. If the value passed i...
The number of items in a Collection can be obtained by calling its .Count function: Syntax: .Count() Sample Usage: Public Sub Example() Dim foo As New Collection With foo .Add "One" .Add "Two" .Add "Three" .Add...
Items can be retrieved from a Collection by calling the .Item function. Syntax: .Item(index) ParameterDescriptionindexThe item to retrieve from the Collection. If the value passed is a numeric type or Variant with a numeric sub-type, it will be interpreted as a numeric index. If the value pas...
Keys Unlike a Scripting.Dictionary, a Collection does not have a method for determining if a given key exists or a way to retrieve keys that are present in the Collection. The only method to determine if a key is present is to use the error handler: Public Function KeyExistsInCollection(ByVal key...
The easiest way to clear all of the items from a Collection is to simply replace it with a new Collection and let the old one go out of scope: Public Sub Example() Dim foo As New Collection With foo .Add "One" .Add "Two" .Add "Thre...

Page 60 of 99