Tutorial by Examples

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { QWidget* w = new QWidget(this); QHBoxLayout* hbox = new QHBoxLayout(); QVBoxLayout* vBox = new QVBoxLayout(); menuA = new MainMenuListView(w, "Images"); menuB = new MainMenuListView(w, "Video...
Here is a sample output: As you can seen above, it can be useful for creating stacked menus. Note that this sample is trivial. The two widgets have the same size constraints.
The QTimer::singleShot is used to call a slot/lambda asynchronously after n ms. The basic syntax is : QTimer::singleShot(myTime, myObject, SLOT(myMethodInMyObject())); with myTime the time in ms, myObject the object which contain the method and myMethodInMyObject the slot to call So for exampl...
tf.gather_nd is an extension of tf.gather in the sense that it allows you to not only access the 1st dimension of a tensor, but potentially all of them. Arguments: params: a Tensor of rank P representing the tensor we want to index into indices: a Tensor of rank Q representing the indices into ...
You can combine mulple layout thanks to other QWidgets in your main layout to do more specifics effects like an information field: for example: #include <QApplication> #include <QMainWindow> #include <QWidget> #include <QVBoxLayout> #include <QPushButton> #inclu...
The grid layout is a powerful layout with which you can do an horizontal and vertical layout a once. example: #include "mainwindow.h" #include <QApplication> #include <QMainWindow> #include <QWidget> #include <QVBoxLayout> #include <QPushButton> #inc...
Let's suppose we want raise x to a number y. You'd write this as: def raise_power(x, y): return x**y What if your y value can assume a finite set of values? Let's suppose y can be one of [3,4,5] and let's say you don't want offer end user the possibility to use such function since it is v...
Detailed instructions on getting blackberry set up or installed.
Detailed instructions on getting apk set up or installed.
To set up a simple hibernate project using XML for the configurations you need 3 files, hibernate.cfg.xml, a POJO for each entity, and a EntityName.hbm.xml for each entity. Here is an example of each using MySQL: hibernate.cfg.xml <?xml version="1.0" encoding="utf-8"?> &...
Detailed instructions on getting rmarkdown set up or installed.
This is an example of how you would do a one to many mapping using XML. We will use Author and Book as our example and assume an author may have written many books, but each book will only have one author. Author class: public class Author { private int id; private String firstName; ...
To comment or uncomment code select the lines and use Ctrl + Shift + C or Ctrl + Shift + /
To access the Open Resource dialog use Ctrl + Shift + R. From here you can start typing a resource name and it will find all matches in the workspace, this makes it easier to find a file when you don't know exactly were it is.
If you want System.out.println(); but don't want to type the whole thing out you can just type syso and hit Ctrl + Spacebar. It will type the rest and set the cursor between the parenthesis.
Eclipse can generate basic getters and setters for you. Right click in you class file and go to Source - Generate Getters and Setters (ALT+SHIFT+S). This will open a dialog where you can choose which fields you would like to have getters and setters generated for.
hql = "From EntityName";
hql = "Select id, name From Employee";
hql = "From Employee where id = 22";
hql = "From Author a, Book b Where a.id = book.author";

Page 1180 of 1336