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
def booking | |
session = Session.find(params[:id]) | |
booking = Booking.create(:session_id => session) | |
@user.bookings << booking | |
redirect_to users_path | |
end | |
class Session < ActiveRecord::Base | |
has_many :bookings |
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 static byte[] Decrypt(byte[] pData, int len, int nCrcSeed) { | |
nCrcSeed = Integer.reverseBytes(nCrcSeed); | |
// System.out.println("Decrypt. Original buffer: "); | |
// printPacketData(pData); | |
int offset = 0; | |
int[] Data; | |
byte[] byteData; | |
if (pData[0] == 0) { | |
len -= 4; | |
offset = 2; |
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
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------ | |
1> Checking Build System | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/anh/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/plugins/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/plugins/phpbb_auth/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/plugins/smf_auth/CMakeFiles/generate.stamp is up-to-date. | |
1> CMake does not need to re-run because C:/Users/Patrick/swganh/build/src/swganh/CMakeFiles/generate.stamp is up-to-date. | |
2>------ Build started: Project: libanh, Configur |
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
Patrick@PATRICK-PC ~/swganh/data/docs (develop) | |
$ generate_python_api.bat | |
Making output directory... | |
Running Sphinx v1.1.2 | |
['c:\\Python32\\Scripts', 'c:\\Python32\\lib\\site-packages\\distribute-0.6.24-p | |
y3.2.egg', 'c:\\Python32\\lib\\site-packages\\sphinx-1.1.2-py3.2.egg', 'c:\\Pyth | |
on32\\lib\\site-packages\\docutils-0.8.1-py3.2.egg', 'c:\\Python32\\lib\\site-pa | |
ckages\\jinja2-2.6-py3.2.egg', 'c:\\Python32\\lib\\site-packages\\pygments-1.4-p | |
y3.2.egg', 'C:\\Windows\\system32\\python32.zip', 'c:\\Python32\\DLLs', 'c:\\Pyt | |
hon32\\lib', 'c:\\Python32', 'c:\\Python32\\lib\\site-packages', 'c:\\Python32\\ |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
int main(void) | |
{ | |
int up[2]; | |
int down[2]; | |
pipe(up); |
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
$(function () { | |
$("select#Rooms").val("0"); | |
$("select#room_Children").val("0"); | |
$("select#room_Children_ChildrenAges").val("0"); | |
var rooms = 4; | |
for (var room = 1; room <= rooms; room++) { | |
$("div.room#" + room).hide(); |
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 SearchViewModel() | |
{ | |
Rooms = new List<RoomViewModel>(Enumerable.Range(1, 4).Select(rx => | |
new RoomViewModel() | |
{ | |
Id = rx, | |
Adults = new SelectList(Enumerable.Range(0, 5).Select(i => | |
new SelectListItem | |
{ |
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 HandleUrban(IrcChannel channel, IrcMessageEventArgs ircMessageEventArgs) | |
{ | |
var term = ircMessageEventArgs.Text.Split(' ').Last(); | |
var urbanService = DependencyFactory.Resolve<UrbanService>(); | |
UrbanResponse urbanResponse = urbanService.Search(new UrbanRequest() { term = term }); | |
StringBuilder builder = new StringBuilder(); |
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
protected override void OnChannelMessageReceived(IrcChannel channel, IrcMessageEventArgs e) | |
{ | |
if(e.Source is IrcUser) | |
{ | |
if(e.Text.ToLower().StartsWith("!weather")) | |
{ | |
//handleWeather(channel, e); | |
} | |
if(e.Text.ToLower().StartsWith("!google")) |
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 class UrbanService : IUrbanService | |
{ | |
private const string BaseUrl = "http://urbanscraper.herokuapp.com/"; | |
public T Execute<T>(RestRequest request) where T : new() | |
{ | |
var client = new RestClient() { BaseUrl = BaseUrl }; | |
client.ClearHandlers(); | |
client.AddHandler("text/plain", new JsonDeserializer()); |
OlderNewer