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
DefaultTableModel tm = new DefaultTableModel(); | |
Vector<String> columns = new Vector<String>(); | |
columns.add("ID"); | |
columns.add("From"); | |
columns.add("To"); | |
columns.add("Departure Time"); | |
columns.add("Fare"); | |
tm.setColumnIdentifiers(columns); |
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
private void deleteRouteBtnActionPerformed(java.awt.event.ActionEvent evt) { | |
int row = routeListTable.getSelectedRow(); | |
if(row != -1){ | |
String routeId = routeListTable.getValueAt(row, 0).toString(); | |
deleteRoute(Integer.parseInt(routeId)); | |
loadRoutes(); | |
}else{ | |
JOptionPane.showMessageDialog(null, "You Must Select A Row To Delete"); | |
} | |
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 void deleteRoute(int routeId){ | |
Route r = em.find(Route.class, routeId); | |
em.getTransaction().begin(); | |
em.remove(r); | |
em.getTransaction().commit(); | |
} |
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
birthdate_s = "21/07/2013" | |
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); | |
Date birthdate = new Date(); | |
try { | |
birthdate = df.parse(birthdate_s); | |
} catch (ParseException ex) { | |
Logger.getLogger(MainScreen.class.getName()).log(Level.SEVERE, null, ex); | |
} |
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
# POST /orders | |
# POST /orders.json | |
def create | |
@order = current_user.orders.new(params[:order]) | |
@order.add_line_items_from_cart(current_cart) | |
@order.payment.amount = @order.total_price | |
@order.payment.save | |
respond_to do |format| | |
if @order.save | |
Cart.destroy(session[:cart_id]) |
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
# POST /orders | |
# POST /orders.json | |
def create | |
@order = current_user.orders.new(params[:order]) | |
@order.add_line_items_from_cart(current_cart) | |
@order.payment.amount = @order.total_price | |
@order.payment.save | |
respond_to do |format| | |
if @order.save | |
Cart.destroy(session[:cart_id]) |
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
username = 'beydogan' | |
user_repos = github.repos.list user: username | |
user_orgs = github.orgs.list user: username | |
user_repos.each do |repo| | |
name = repo.name | |
owner = repo.owner.login | |
commits = github.repos.commits.list owner, name, :author => username |
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
username = 'beydogan' | |
user_files = [] | |
user_repos = github.repos.list user: username | |
user_orgs = github.orgs.list user: username | |
user_repos.each do |repo| | |
name = repo.name | |
owner = repo.owner.login | |
commits = github.repos.commits.list owner, name, :author => username |
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
class CreateCommitPoints < ActiveRecord::Migration | |
def change | |
create_table :commit_points do |t| | |
t.integer :commit_id | |
t.integer :language_id | |
t.float :point | |
end | |
add_index :commit_points, [:commit_id, :language_id] |
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
INSERT INTO EMPLOYEE VALUES | |
(2, | |
NAME_TYPE(TEMPORAL_VARCHAR('23.11.2003','09.09.2099','James Brown')), | |
ADDRESS_TYPE(TEMPORAL_VARCHAR('23.11.2003','09.09.9999','BUCA')), | |
'23.11.2003', | |
MANAGER_TYPE(TEMPORAL_VARCHAR('23.11.2003','09.09.9999','Mike White')), | |
DEPARTMENT_TYPE(TEMPORAL_VARCHAR('23.11.2003','09.09.9999','DEPT_ID05')), | |
SALARY_TYPE(TEMPORAL_NUMBER('23.11.2003','09.09.9999', 250000)) | |
); |
OlderNewer