Tutorial by Examples: o

Introduction CooCox CoIDE, a free and highly-integrated software development environment for ARM Cortex MCUs. Description from ST Microelectronics: CoIDE is a free software development environment based on Eclipse and GCC tool chain, which has been customized and simplified to give users an ea...
Some of the queryFor* methods available in JdbcTemplate are useful for simple sql statements that perform CRUD operations. Querying for Date String sql = "SELECT create_date FROM customer WHERE customer_id = ?"; int storeId = jdbcTemplate.queryForObject(sql, java.util.Date.class, custom...
int storeId = 1; DataSource dataSource = ... // JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String sql = "SELECT * FROM customer WHERE store_id = ?"; List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, storeId); for(Map<String, Object> ...
DataSource dataSource = ... // JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String sql = "SELECT * FROM customer"; SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql); while(rowSet.next()) { String firstName = rowSet.getString("first_name"); String lastN...
This is a simple RMI example with five Java classes and two packages, server and client. Server Package PersonListInterface.java public interface PersonListInterface extends Remote { /** * This interface is used by both client and server * @return List of Persons * @throws...
Lists as arguments are just another variable: def func(myList): for item in myList: print(item) and can be passed in the function call itself: func([1,2,3,5,7]) 1 2 3 5 7 Or as a variable: aList = ['a','b','c','d'] func(aList) a b c d
Tkinter has three mechanisms for geometry management: place, pack, and grid. The place manager uses absolute pixel coordinates. The pack manager places widgets into one of 4 sides. New widgets are placed next to existing widgets. The grid manager places widgets into a grid similar to a dynamicall...
In addition to libraries defined in EcmaScript language specification and EcmaScript internationalization API specification, d8 also implements the following functions and objects. print(args...): function. Print to stdout. printErr(args...): function. Print to stderr. write(args...): function....
If you have a virtualenv and CherryPy is already installed in it, create a file hello.py: #!/usr/bin/env python # -*- coding: UTF-8 -*- import cherrypy class HelloWorld(object): @cherrypy.expose def index(self): return 'Hello World!' @cherrypy.expose def greet(...
This example consists of three parts: server.py - CherryPy application that can receive and save a file. webpage.html - Example how to upload a file to server.py from a webpage. cli.py - Example how to upload a file to server.py from a command line tool. Bonus - upload.txt - file that you will...
If class A is in relationship with class B and class B has property with the same name and type as the primary key of A, then EF automatically assumes that property is foreign key. public class Department { public int DepartmentId { set; get; } public string Name { set; get; } publi...
As we all are aware that PHP writes session data into a file at server side. When a request is made to php script which starts the session via session_start(), PHP locks this session file resulting to block/wait other incoming requests for same session_id to complete, because of which the other requ...
WPF does not support displaying anything other than an image as a splash screen out-of-the-box, so we'll need to create a Window which will serve as a splash screen. We're assuming that we've already created a project containing MainWindow class, which is to be the application main window. First of...
WPF does not support displaying anything other than an image as a splash screen out-of-the-box, so we'll need to create a Window which will serve as a splash screen. We're assuming that we've already created a project containing MainWindow class, which is to be the application main window. First of...
# app/channels/application_cable/connection.rb module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect self.current_user = find_verified_user logger.add_tags 'ActionCable', current_user.id # Can replace...
One day I had a conversation with a friend of mine who uses Laravel PHP framework in his job. When I told him that Django has its own all-included HTML CRUD system, for interacting with the database, called Django admin, his eyes popped off! He told me: "It took me months to build an Admin inte...
Create the source file for your new Client Script Create a new JavaScript file using your favorite editor or IDE Add the following source code to your file (original source here) /** * A simple "Hello, World!" example of a Client Script. Uses the `pageInit` * event to wr...
Create the source file for your new Client Script Create a new JavaScript file using your favorite editor or IDE Add the following source code to your file (original source here) define([], function () { /** * A simple "Hello, World!" example of a Client Script. U...
Add the following code in you main program. var cpuprofile = flag.String("cpuprofile", "", "write cpu profile `file`") var memprofile = flag.String("memprofile", "", "write memory profile to `file`") func main() { flag.Parse() ...
var memprofile = flag.String("memprofile", "", "write memory profile to `file`") func main() { flag.Parse() if *memprofile != "" { f, err := os.Create(*memprofile) if err != nil { log.Fatal("could not create mem...

Page 787 of 1038