This file contains hidden or 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
package com.alansparrow.chat; | |
import gnu.io.CommPortIdentifier; | |
import gnu.io.PortInUseException; | |
import gnu.io.SerialPort; | |
import gnu.io.SerialPortEvent; | |
import gnu.io.SerialPortEventListener; | |
import gnu.io.UnsupportedCommOperationException; | |
import java.io.IOException; |
This file contains hidden or 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
import java.io.*; | |
import java.net.*; | |
import java.text.SimpleDateFormat; | |
import java.util.*; | |
/* | |
* The server that can be run both as a console application or a GUI | |
*/ | |
public class Server { | |
// a unique ID for each connection |
This file contains hidden or 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
import java.net.*; | |
import java.io.*; | |
import java.util.*; | |
/* | |
* The Client that can be run both as a console or a GUI | |
*/ | |
public class Client { | |
// for I/O |
This file contains hidden or 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
%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %LM - %c |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef int Edge; | |
typedef int Vertex; | |
int numberOfVertices = 0; | |
int currentComponentNumber = 0; | |
Edge **edges = NULL; | |
Vertex *vertices = NULL; |
This file contains hidden or 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
Actually you don't need gem for this, here is the step to install Bootstrap 3 in RoR | |
Download Bootstrap | |
Copy bootstrap/dist/css/bootstrap.css and bootstrap/dist/css/bootstrap.min.css to vendor/assets/stylesheets | |
Copy bootstrap/dist/js/bootstrap.js and bootstrap/dist/js/bootstrap.min.js to vendor/assets/javascripts | |
Update app/assets/stylesheets/application.css | |
*= require bootstrap | |
Update app/assets/javascripts/application.js |
This file contains hidden or 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
/* | |
Distributed under The MIT License: | |
http://opensource.org/licenses/mit-license.php | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to |
This file contains hidden or 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
Success may come from what seems to be the craziest ideas. The twelve-year-old boy in this story would be the prime example of that statement. At that time, since life so hard and poor that children hardly had a decent toy to play, the boy decided to sell his self-made toy ships and get money to buy "his dream"-an radio-controlled car. With his skillful hands and creative mind, he disassembled his broken toy cars to get tiny motors, and then put them on pieces of foam to make new toys which could travel on water surface. Those toys were simple but so interesting that most of his neighboring children owned one. Each toy ship brought him 2000 to 5000 VND (Vietnamese currency) depending on its size and decoration. His sale was a big success but when the boy saved almost enough for the radio-controlled car, he was out of components. He intended to quit the business and asked his parents for the rest of money, but they rejected him. They said: “You’d better pursue your goal until the end instead of giving up". Af |
This file contains hidden or 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 Cart < ActiveRecord::Base | |
has_many :line_items, dependent: :destroy | |
def add_product(product_id) | |
current_item = line_items.find_by(product_id: product_id) | |
if current_item | |
current_item.quantity += 1 | |
else | |
current_item = line_items.build(product_id: product_id) | |
end |
This file contains hidden or 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
/* Flatten das boostrap */ | |
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid { | |
-moz-box-shadow: none !important; | |
-webkit-box-shadow: none !important; | |
box-shadow: none !important; | |
-webkit-border-radius: 0px !important; | |
-moz-border-radius: 0px !important; | |
border-radius: 0px !important; | |
border-collapse: collapse !important; | |
background-image: none !important; |