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
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.io.PipedInputStream; | |
import java.io.PipedOutputStream; | |
import java.io.Serializable; | |
public class TestApp { | |
public static class DataPackage implements Serializable { |
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
// Distributed Systems - JEE/CarRental-ejb/src/java/session/CarRentalSession.java: | |
@Override | |
public List<CarType> getAvailableCarTypes(Date start, Date end) { | |
final Query query = em.createNamedQuery("CarRentalCompany.findAll", CarRentalCompany.class); | |
final List<CarType> availableCarTypes = new LinkedList<CarType>(); | |
final List<CarRentalCompany> companies = query.getResultList(); | |
for (final CarRentalCompany rentalCompany : companies) | |
for(final CarType type : rentalCompany.getAvailableCarTypes(start, end)) | |
if(!availableCarTypes.contains(type)) |
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
uint8 input[] = { 'd' }; | |
uint8 digest[20]; | |
sha1_context *ctx = malloc(sizeof(struct sha1_context)); | |
sha1_starts (ctx); | |
sha1_update (ctx, input, 2); | |
sha1_finish (ctx, digest); |
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
<?php | |
require_once("ajax_table.class.php"); | |
// [dennis] rename your object from ajax_table to AjaxTable (conventions) | |
// [dennis] rename your object to AjaxRepository (semantics) | |
$obj = new ajax_table(); | |
// [dennis] use the $_SERVER variable to determine the request method. | |
if($_SERVER['REQUEST_METHOD'] == 'POST') { | |
// whats the action ?? |
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
<?php | |
// [dennis] read suggestions on your class name in the ajax.php comments | |
class ajax_table { | |
public function __construct(){ | |
$this->dbconnect(); | |
} | |
private function dbconnect() { | |
$conn = mysqli_connect("localhost","root","","ajax_table") |
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
<?php | |
class Router { | |
private $_defaultParameters; | |
public Router($defaultParameters) { | |
$this->_defaultParameters = $defaultParameters; | |
} | |
public function route($uri) { |
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
<?php | |
// Establishing Connection with Server.. | |
$connection = mysqli_connect("localhost", "root", "") | |
or die("Could not connect to database at 'localhost'"); | |
// Selecting Database | |
mysql_select_db($connection, "ajax") | |
or die("Could not open database 'ajax'"); | |
?> |
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
<table class="table tab-content" style="width:95%" align="center"> | |
<tr class="row"> | |
<td style="width:100px; height=100%;" rowspan="2"> | |
<img width="100%" src="adimg/autos/11.jpg"/> | |
</td> | |
<td colspan="2"> | |
<h4 class="h4">This is a new Car please call</h4> | |
</td> | |
</tr> | |
<tr class="row" > |
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
<?php | |
/** | |
* This package can be used to display query results split in pages using PDO | |
* | |
* It is based on my primary classe available on | |
* http://www.phpclasses.org/browse/file/40496.html | |
* and since the most usage is been from countries outside Brazil | |
* I've ported the class methods and properties names to English | |
* |
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
<?php | |
// some templates | |
$link = '<a href="%uri%">%text%</a>'; | |
$strong = '<strong>%text%</strong>'; | |
// some data | |
$linkUri = "http://example.com"; | |
$linkText = "example"; | |
$strongText = "foobar"; |
OlderNewer