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
latest table: | |
ItemID int (11), // ID of the product / item | |
ShopID int (11), // ID of the store that sells it | |
Buy int (11), // price the items are sold for (as in, price the customer buys it for) | |
Sell int (11), // price the items are bought for (as in, price the customer gets for it, if he sells it in this store) | |
Count int (11), // amount of items sold/bought (the prices are with the amount, if the price is 10 and the amount 16 it means the 16 cost 10, not that 1 costs 10) | |
Primary Key (ItemID,ShopID) | |
Problem: trying to get entries where the price the item can be bought at is lower than the price it can be sold for, at any store |
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
-- phpMyAdmin SQL Dump | |
-- version 3.3.9 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Erstellungszeit: 25. August 2011 um 20:37 | |
-- Server Version: 5.5.8 | |
-- PHP-Version: 5.3.5 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
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
[17:14:14] [Server thread/ERROR] [FML]: The following problems were captured during this phase | |
[17:14:14] [Server thread/ERROR] [FML]: Caught exception from WorldEdit | |
java.lang.NoClassDefFoundError: com/thoughtworks/paranamer/Paranamer | |
at com.sk89q.worldedit.extension.platform.CommandManager.<init>(CommandManager.java:96) ~[CommandManager.class:?] | |
at com.sk89q.worldedit.extension.platform.PlatformManager.<init>(PlatformManager.java:86) ~[PlatformManager.class:?] | |
at com.sk89q.worldedit.WorldEdit.<init>(WorldEdit.java:93) ~[WorldEdit.class:?] | |
at com.sk89q.worldedit.WorldEdit.<clinit>(WorldEdit.java:89) ~[WorldEdit.class:?] | |
at com.sk89q.worldedit.forge.ForgeWorldEdit.serverAboutToStart(ForgeWorldEdit.java:114) ~[ForgeWorldEdit.class:?] | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] | |
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] |
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
fn handle_client(mut stream: TcpStream) { | |
let mut buf: [u8; 1024] = [0; 1024]; | |
stream.read(&mut buf); | |
let data = str::from_utf8(&buf).unwrap(); | |
stream.close_read(); | |
let mut method: &str = ""; | |
let mut path: &str = ""; | |
let mut http_version: &str = ""; | |
let mut headers: HashMap<&str, &str> = HashMap::new(); | |
let mut error = None; |
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
use std::io::{TcpListener, TcpStream}; | |
use std::io::{Acceptor, Listener}; | |
use std::collections::HashMap; | |
use std::io::Reader; | |
use std::io::fs::File; | |
use std::io::Read; | |
use std::io::Open; | |
static BASE_PATH: &'static str = "./pub/"; |
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
fn get_file_contents(path: &str) -> IoResult<String> { | |
let p = Path::new(BASE_PATH.to_string() + path); | |
let file = try!(File::open_mode(&p, Open, Read)); | |
let read_u8 = try!(file.read_to_end()); | |
let read = try!(std::str::from_utf8(&*read_u8)); | |
Ok(read.to_string()) | |
} |
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
before: | |
fn get_file_contents(path: &str) -> Result<String, &'static str> { | |
let p = Path::new(BASE_PATH.to_string() + path); | |
let res: Result<String, &'static str>; | |
let file_result = File::open_mode(&p, Open, Read); | |
res = match file_result { | |
Ok(mut file) => { | |
let read_result_u8 = file.read_to_end(); | |
match read_result_u8 { |
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
#[no_mangle] | |
pub extern "C" fn test() -> int { | |
return 1; | |
} |
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
use std::fmt; | |
use std::io; | |
use std::cell::RefCell; | |
use std::collections::HashMap; | |
pub enum ConfigValue { | |
String(String), | |
Number(isize), | |
Null | |
} |
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
use std::io::{TcpListener, TcpStream}; | |
use std::io::{Acceptor, Listener}; | |
use std::str; | |
fn handle_client(mut stream: TcpStream) { | |
let mut buf: [u8; 1024] = [0; 1024]; | |
let read_size = stream.read(&mut buf); | |
match read_size { | |
Ok(s) => { | |
let mut ss = String::from_str(str::from_utf8(&buf)); |
OlderNewer