text:
ImageWriter::ImageWriter(int width, int height, int bands_per_pixel, int bits_per_band) :
  m_width(width), m_height(height), m_bands_per_pixel(bands_per_pixel), m_bits_per_band(bits_per_band) {}

std::auto_ptr<ImageWriter> ImageWriter::open(const std::string &filename, int width, int height, int bands_per_pixel, int bits_per_band) {
  std::string format = filename_suffix(filename);
  if (iequals(format, "kro")) return std::auto_ptr<ImageWriter>(new KroWriter(filename, width, height, bands_per_pixel, bits_per_band));
  //if (iequals(format, "jpg")) return auto_ptr<ImageWriter>(new JpegWriter(filename));
  throw_error("Unrecognized image format from %s", filename.c_str());
  assert(0);
}

void ImageWriter::write(const std::string &filename, int width, int height, int bands_per_pixel, int bits_per_band, unsigned char *pixels) {
  std::auto_ptr<ImageWriter> writer(open(filename, width, height, bands_per_pixel, bits_per_band));
  writer->write_rows(pixels, height);
  writer->close();
}

KroWriter::KroWriter(const std::string &filename, int width, int height, int bands_per_pixel, int bits_per_band) :
  ImageWriter(width, height, bands_per_pixel, bits_per_band), filename(filename) {
  out = fopen(filename.c_str(), "wb");
  if (!out) throw_error("Can't open %s for writing", filename.c_str());
  setvbuf(out, NULL, _IOFBF, 1024*1024); // increase buffering to 1MB
  unsigned char header[20];
  write_u32_be(&header[0], 0x4b52f401); // KRO\001
  write_u32_be(&header[4], width);
  write_u32_be(&header[8], height);
  write_u32_be(&header[12], bits_per_band);
  write_u32_be(&header[16], bands_per_pixel);
  if (1 != fwrite(header, sizeof(header), 1, out)) {
    throw_error("Can't write header to %s", filename.c_str());
  }
}

void KroWriter::write_rows(const unsigned char *pixels, unsigned int nrows) const {
  if (1 != fwrite(pixels, nrows * bytes_per_row(), 1, out)) {
    throw_error("Error writing pixels to %s", filename.c_str());
  }
}

void KroWriter::close() {
  if (out) {
    fclose(out);
    out = NULL;
  }
}

KroWriter::~KroWriter() {
  close();
}

//JpegWriter::JpegWriter(const char *filename) : filename(filename) {
//  in = fopen(filename, "rb");
//  if (!in) throw runtime_error(string_printf("Can't open %s for writeing", filename));
//
//  cinfo.err = jpeg_std_error(&jerr);
//  jpeg_create_decompress(&cinfo);
//  jpeg_stdio_src(&cinfo, in);
//  jpeg_write_header(&cinfo, TRUE);
//  jpeg_start_decompress(&cinfo);
//  bands_per_pixel = cinfo.output_components;
//  bits_per_band = 8;
//  width = cinfo.output_width;
//  height = cinfo.output_height;
//}
//
//void JpegWriter::write_rows(const unsigned char *rgb_pixels, unsigned int nrows) const {
//  vector<unsigned char*> rowptrs(nrows);
//  for (unsigned i = 0; i < nrows; i++) {
//    rowptrs[i] = rgb_pixels + i * bytes_per_row();
//  }
//  unsigned nwrite = 0;
//  while (nwrite < nrows) {
//    nwrite += jpeg_write_scanlines(&cinfo, &rowptrs[nwrite], nrows - nwrite);
//  }
//}
//
//void JpegWriter::close() {
//  if (in) {
//    jpeg_finish_decompress(&cinfo);
//    jpeg_destroy_decompress(&cinfo);
//    fclose(in);
//    in = NULL;
//  }
//}
//
//JpegWriter::~JpegWriter() {
//  close();
//}


Viewer : 7.833.080 by : ISPR Official.
Viewer : 1.378.697 by : Imamia Videos Pakistan.
Viewer : 4.457.864 by : ISPR Official.
Viewer : 5.982.258 by : 24 News HD.
Viewer : 747.072 by : Sh33n Studio.
Viewer : 7.440.386 by : ISPR Official.
Viewer : 15.018.716 by : ISPR Official.
Viewer : 7.740.793 by : ISPR Official.
Viewer : 1.871.804 by : New Tech.
Viewer : 6.062.158 by : ISPR Official.
Viewer : 8.393.869 by : ISPR Official.
Viewer : 4.101.495 by : Best Choice.
Viewer : 22 by : Ayezha Khan.
Viewer : 31 by : All-in-One Tube.
Viewer : 621 by : Ahsan CreatiOns.
Viewer : 94 by : AK Videos.
Viewer : 4.198.220 by : ISPR Official.


The Army issued a new directive last week to govern the growing use of unmanned aircraft systems (UAS) or "drones" within the United States for training missions and for "domestic operations."
"The Army's unmanned aircraft systems represent emerging technology that requires access to the National Airspace System," wrote Army Secretary John M. McHugh in a January 13 memorandum (http://www.fas.org/irp/doddir/army/ad2012_02.pdf).
Towards that end, the Army produced a revised policy on UAS operations to support "expanded UAS access to the National Airspace System." A copy of the new policy was obtained by Secrecy News. See Army Directive 2012-02 (http://www.fas.org/irp/doddir/army/ad2012_02.pdf), January 13, 2012.
Much of the Army's UAS activity will be devoted to UAS operator training conducted at or near military facilities, the policy indicates. But beyond such training activities, the military also envisions a role for UAS in unspecified "domestic operations" in civilian airspace, according to a 2007 Memorandum of Agreement between the Department of Defense and the Federal Aviation Administration, which regulates domestic air traffic.
The 2007 Memorandum, which is appended to the new Army directive (http://www.fas.org/irp/doddir/army/ad2012_02.pdf), was said to "allow, in accordance with applicable law, increased access for DoD UAS into the elements of the NAS [National Airspace System] outside of DoD-managed Restricted Areas or Warning Areas."
The 2007 agreement was intended to "ensure DoD UAS assets have NAS access for domestic operations, including the War on Terror (WOT).... This guidance applies to all DoD UAS, whether operated by Active, Reserve, National Guard, or other personnel."
A prior edition of the Army's "Unmanned Aircraft System Flight Regulations," which will be updated to incorporate the latest policy, can be found on the Federation of American Scientists web site here (http://www.fas.org/irp/doddir/army/ar95-23.pdf).
The Electronic Frontier Foundation last week filed a Freedom of Information Act lawsuit seeking information (https://www.eff.org/press/releases/who-flying-unmanned-aircraft-us) on domestic drone operations.
Some new or updated reports from the Congressional Research Service that have not been made readily available to the public include the following (all pdf).


text:
Funding Overview
Funding Programmes
Regular Funding
Open Project Funding
Targeted Funding
Funds Delivered by Partners
Help With Your Application
Help With Your Budget
How to submit your supporting materials
Alternative Formats, Languages and Access Support
Funding Privacy Notice
Funding Archive
Home > Funding > Funding Programmes > Targeted Funding > Made in Scotland
Made in Scotland Funding
Made in Scotland is a curated showcase promoting high-quality music, theatre and dance to international promoters and audiences at the Edinburgh Festival Fringe. It's a partnership between the Edinburgh Festival Fringe Society, the Federation of Scottish Theatre, the Scottish Music Centre and Creative Scotland, and is supported through the Scottish Government's Edinburgh Festivals Expo Fund - awarded to the Edinburgh Festival Fringe Society.
The purpose of the Programme is to raise the international profile of Scottish artists through the promotion of Scottish work at the Edinburgh Festival Fringe, and this fund supports the Made in Scotland Showcase as well as Onward International Touring.
Made in Scotland Showcase 2019
This showcase celebrates the wealth and diversity of work that is currently being produced in Scotland. Scottish dance, theatre, and music artists, groups and companies can apply to present artistically ambitious work at the Fringe as part of the Made in Scotland 2019 Showcase. Funding is intended to support the costs of presenting work at the Fringe. The work can be new or an existing production which will be re-staged at the Fringe.
We are looking for individuals, groups and organisations based in Scotland and working in theatre, dance and music to be part of Made in Scotland 2019. Applications can come from individual artists, companies, organisations, ensembles, promoters, bands and record labels.
This fund is only open to applicants based in Scotland, therefore companies and organisations must be based here and individuals must be able to demonstrate that their principal home is in Scotland. Student and non-professional companies are not eligible to apply.
Organisations already in receipt of Creative Scotland Regular Funding or project funds are eligible to apply, but need to clearly demonstrate the additional benefits that support from Made in Scotland will present.
The deadline for applications for the Made in Scotland Showcase 2019 has now passed. It was 22 November 2018.
Onward International Touring
One of the key aims of Made in Scotland is to maximise the benefit for Scottish artists on the international platform that is the Fringe. As part of this, funding is available to support any work created in Scotland which attracts interest from international promoters as a result of being showcased at the Edinburgh Festival Fringe - it is not just limited to those companies which have been part of a current or previous Made in Scotland Showcase.
The Made in Scotland Onward Touring fund is open to any individual or company based in Scotland which has presented a professional piece of theatre, dance or music at the Edinburgh Festival Fringe, and which, as a result, was seen by and programmed by an international presenter.
Made in Scotland Onward Touring Fund is currently closed and will re-open early September 2019.
Made in Scotland Guidance 2019
Read and download the Made in Scotland application guidance in .pdf format.
Made in Scotland Onward International Touring Guidelines
View and download the Made in Scotland Onward International Touring guidelines in pdf format.
If you require more information on the Made in Scotland Showcase visit the Made in Scotland website or email the Festival Fringe Office on madeinscotland@edfringe.com.
If you require further information on the Made in Scotland Onward International Touring Fund, contact Laura Mackenzie-Stuart: laura.mackenzie-stuart@creativescotland.com.
If you require any other general advice about Creative Scotland funding please contact our Enquiries Service.
Email: enquiries@creativescotland.com
Tel: 0345 603 6000*
(Lines open 10am – 12noon, and 2 - 4pm Mon - Fri – and voicemail during busy periods and out with these hours.)
If you are a deaf BSL user, you can access our services with the Contact Scotland-BSL programme. Go to www.contactscotland-bsl.org/public for more information
* Please note: Calls to our 0345 number are charged at the same rate as calling national 01 or 02 numbers. Approximate charges are up to 9p per minute from landlines and between 3p – 55p per minute from mobiles. However, calls to this number are also part of inclusive allowances. Please check with your phone line provider for exact charges.
Sufi Festival 2019: 'Promoting harmony and cohesion within the community'
HebCelt 2019: Showcasing heritage through music
Alexia Holt on Cove Park's Scotland + Venice journey - from Argyll to the Biennale and back again
40 projects across Scotland share over £700,000 Open Project Funding
New funding supports Scottish tours for acclaimed theatre & dance
CashBack for Creativity Open Fund: £324k awarded to arts projects

redpajama_set_name: RedPajamaCommonCrawl


A company profile of Taylor Corp., the largest printing and marketing companies in the U.S., is presented. An overview of the company is given, along with key facts including contact information, number of employees and revenues. A SWOT analysis is provided which includes strengths, weaknesses, opportunities for improvement and threats.
Presents key facts about Taylor Corp., a private holding company for its subsidiaries that operate in the business of commercial printing. Address and contact information; Revenues and financial year end data; Number of employees; SIC and NAICS codes.
Presents an overview of Taylor Corp., a private holding company for its subsidiaries that operate in the business of commercial printing. Revenues generated in fiscal year 2002.


text:
Q: Plotting a large number of custom functions in ggplot in R using stat_function() The basic issue is that I'd like to figure out how to add a large number (1000) custom functions into the same figure in ggplot, using different values for the function coefficients.  I have seen other questions about how to add two or three functions, but not 1000, and questions about adding in different functional forms, but not the same form with multiple values for the parameters...
The goal is to have stat_function draw the lines over using parameters values stored in a data frame, but with no actual data for x.
[The overall goal here is to show the large uncertainty in the model parameters of a non-linear regression from a small dataset, which translates into uncertainty associated with predictions from this data (which I'm trying to convince someone else is a bad idea).  I often do this by plotting many lines built from the uncertainty in the model parameters, (a la Andrew Gelman's Multilevel Regression textbook).]
As an example, here is the plot in the base R graphics.
#The data
p.gap <- c(50,45,57,43,32,30,14,36,51)
p.ag <- c(43,24,52,46,28,17,7,18,29)
data <- as.data.frame(cbind(p.ag, p.gap))

#The model (using non-linear least squares regression):
fit.1.nls <- nls(formula=p.gap~beta1*p.ag^(beta2), start=list(beta1=5.065, beta2=0.6168))
summary(fit.1.nls)

#From the summary, I find the means and s.e's the two parameters, and develop their distributions:
beta1 <- rnorm(1000, 7.8945, 3.5689)
beta2 <- rnorm(1000, 0.4894, 0.1282)
coefs <- as.data.frame(cbind(beta1,beta2))

#This is the plot I want (using curve() and base R graphics):
plot(data$p.ag, data$p.gap, xlab="% agricultural land use",
     ylab="% of riparian buffer gap", xlim=c(0,130), ylim=c(0,130), pch=20, type="n")
for (i in 1:1000){curve(coefs[i,1]*x^(coefs[i,2]), add=T, col="grey")}
curve(coef(fit.1.nls)[[1]]*x^(coef(fit.1.nls)[[2]]), add=T, col="red")
points(data$p.ag, data$p.gap, pch=20)

I can plot the mean model function with the data in ggplot:
fit.mean <- function(x){7.8945*x^(0.4894)}
ggplot(data, aes(x=p.ag, y=p.gap)) +
  scale_x_continuous(limits=c(0,100), "% ag land use") +
  scale_y_continuous(limits=c(0,100), "% riparian buffer gap") +
  stat_function(fun=fit.mean, color="red") +
  geom_point()

But nothing I do draws multiple lines in ggplot.  I can't seem to find any help on drawing the parameter values from  of functions on the ggplot website, or on this site, which are both usually very helpful.  Does this violate enough plotting theory that no one dares do this?
Any help is appreciated.  Thank you!

A: You could create a new stat_functions / modify stat_function to accept fun as an aesthetic like this:
# based on code from hadley and others
# found on https://github.com/tidyverse/ggplot2/blob/master/R/stat-function.r
library(rlang)
StatFunctions <- ggproto("StatFunctions", Stat,
                         default_aes = aes(y = stat(y)),
                         required_aes = "fun",

                         compute_group = function(data, scales, xlim = NULL, n = 101, args = list()) {
                           range <- xlim %||% scales$x$dimension()
                           xseq <- seq(range[1], range[2], length.out = n)

                           if (scales$x$is_discrete()) {
                             x_trans <- xseq
                           } else {
                             # For continuous scales, need to back transform from transformed range
                             # to original values
                             x_trans <- scales$x$trans$inverse(xseq)
                           }
                          do.call(rbind,
                                  lapply(data$fun, function(fun)
                                    data.frame(
                                      x = xseq,
                                      y =  do.call(fun, c(list(quote(x_trans)), args))))
                          )
                          }
)

stat_functions <- function(mapping = NULL, data = NULL,
                           geom = "path", position = "identity",
                           ...,
                           xlim = NULL,
                           n = 101,
                           args = list(),
                           na.rm = FALSE,
                           show.legend = NA,
                           inherit.aes = TRUE) {
  layer(
    data = data,
    mapping = mapping,
    stat = StatFunctions,
    geom = geom,
    position = position,
    show.legend = show.legend,
    inherit.aes = inherit.aes,
    params = list(
      n = n,
      args = args,
      na.rm = na.rm,
      xlim = xlim,
      ...
    )
  )
}

And then use it like this:
df <- data.frame(fun=1:3)
df$fun = c(function(x) x, function(x) x^2, function(x) x^3)
ggplot(df,aes(fun=fun, color=as.character(fun)))+
  stat_functions() +
  xlim(c(-5,5))

To get this:

A: It is possible to collect multiple geoms or stats (and even other elements of a plot) into a vector or list and add that vector/list to the plot. Using this, the plyr package can be used to make a list of stat_function, one for each row of coefs
library("plyr")
coeflines <-
alply(as.matrix(coefs), 1, function(coef) {
  stat_function(fun=function(x){coef[1]*x^coef[2]}, colour="grey")
})

Then just add this to the plot
ggplot(data, aes(x=p.ag, y=p.gap)) +
  scale_x_continuous(limits=c(0,100), "% ag land use") +
  scale_y_continuous(limits=c(0,100), "% riparian buffer gap") +
  coeflines +
  stat_function(fun=fit.mean, color="red") +
  geom_point()

A couple of notes:

*

*This is slow. It took a few minutes on my computer to draw. ggplot was not designed to be very efficient at handling circa 1000 layers.

*This just addresses adding the 1000 lines. Per @Roland's comment, I don't know if this represents what you want/expect it to statistically.

redpajama_set_name: RedPajamaStackExchange


The 2016 Open Season for the Federal Employees Health Benefits Program, the Federal Employees Dental and Vision Insurance Program, and the Federal Flexible Spending Accounts Program runs through Dec. 14.
During open season employees and retirees will have the chance to review their current plans and make any changes they desire. For the first time, plan participants may now choose a "self plus one" option.
The self plus one option allows enrollees to cover themselves and one eligible family member. Eligibility for the self plus one option is the same as for the self and family enrollment. Eligible family members include spouses and children under age 26; however, a child with a mental or physical disability that existed before age 26 is also eligible for enrollment as a family member.
Cathro cautions employees to pay close attention and compare the rates for FEHB self plus one versus self and family before making their coverage election for 2016.
OPM will open a 'special enrollment period' in the month of February to allow active FEHB participants who would have been better served switching to self-plus-one coverage more time to make the change.
Some plans are leaving the FEHB program at the end of 2015 or reducing their service areas and terminating their enrollment codes. Employees in the terminating plans must enroll in another health plan to ensure they have health benefits for 2016.
* Reenroll for the next benefit period. If the employee does not re-enroll, the right to carryover funds will be forfeited.
* Dependent care FSAs will continue to have a grace period each year and are not eligible to carryover funds from one year to the next.
There are no significant changes to the Federal Employee Dental and Vision Insurance Program.
Employees can make health benefits elections through the Employee Benefits Information System, which can be accessed through the "Civilian Employee" homepage of the myPers website at https://mypers.af.mil.
For more information about Air Force personnel programs go to the myPers website.


text:
Q: A Button, using telebot library I have a handler for upload documents in telegram bot. I would like to get if user presses button 1 - the handler starts to work. But I can't undestand , what I should do with param message, I need another argument not message in progress_step for my handler of uploading docs and pictures in order to see my uploading file, but now I get for handler text:1.Plese< can you help?
My code:
import telebot
from telebot import types

@bot.message_handler(func=lambda m: True, content_types=['document'])
def handle_docs_photo(message):
            try:
                chat_id = message.chat.id

                file_info = bot.get_file(message.document.file_id)
                downloaded_file = bot.download_file(file_info.file_path)

                src = 'B:/' + message.document.file_name;
                with open(src, 'wb') as new_file:
                    new_file.write(downloaded_file)

                bot.reply_to(message, "save that")
            except Exception as e:
                bot.reply_to(message, e)

@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
    markup = types.ReplyKeyboardMarkup(one_time_keyboard=True)
    markup.add('1', '2') #Имена кнопок
    msg = bot.reply_to(message, 'Test text', reply_markup=markup)
    bot.register_next_step_handler(msg, process_step)

def process_step(message):
    chat_id = message.chat.id
    if message.text=='1':
        #here should be  def handle_docs_photo(message):
    else:
        pass


text:
I Campionati mondiali di sollevamento pesi 1898, 2ª edizione della manifestazione, si svolsero a Vienna tra il 31 luglio e il 1º agosto 1898.

Resoconto
Ai campionati, disputati come il precedente in formato "Open", senza limiti di peso, parteciparono undici atleti rappresentanti di tre nazioni. L'Austria conquistò i primi due posti sul podio, la Russia il terzo.

Risultati

Medagliere

Note

1898
Mondiali
Competizioni sportive a Vienna

redpajama_set_name: RedPajamaWikipedia


text:
import {Injectable} from "@angular/core";
const _ = require('lodash');
import {fileInfo} from "./file-info.model";
import {AbstractFileCreatorService} from "./abstract-file-creator.service";
import {AbstractFileModel} from "./abstract-file.model";

@Injectable()
export class FileListService {
  constructor() {

  }

  public createList(files: Array<fileInfo>, state: string) {
    let currentList = [];
    _.forEach(files, (file) => {
      currentList.push(AbstractFileCreatorService.getCreator(file).create(file, state));
    });
    return currentList;
  }

  public getSelectedList(list: Array<AbstractFileModel>) {
    let selectedFiles = [];
    _.forEach(list, (file) => {
      if(file.isSelected() && file.type === 'file') {
        selectedFiles.push(file);
      }
    });
    return selectedFiles;
  }

  public unselectedList(event: Event, list: Array<AbstractFileModel>) {
    event.stopPropagation();
    _.forEach(list, (file) => {
      file.selected = false;
    });
    return list;
  }

  public selectFilesByShift(list: Array<AbstractFileModel>, fromIndex:number, toIndex:number) {
    _.forEach(_.slice(list, fromIndex, toIndex), (file) => {
      file.switchSelection();
    });
  }
}

redpajama_set_name: RedPajamaGithub


New Hampshire, the Granite State, is an idyllic New England state. The recreational industry in New Hampshire is strong, with historical attractions from the colonial era, beach resorts on the Atlantic Coast and lakes across the state, and large mountain resorts for skiing, hiking, snowmobiling, and sight-seeing the fall foliage. New Hampshire is well-known in American culture and history, especially thanks to New Hampshire being the location of the first presidential primary.
New Hampshire is home to many ideal New England colleges in hilly suburbs across the state. The University of New Hampshire provides numerous engineering degrees ranging from associate's programs to doctorate degrees. The school has two locations: its main campus location in Durham and a regional campus in Manchester, the largest city in New Hampshire.
Keene State College, located in the town of Keene, is the other public college in New Hampshire with baccalaureate engineering programs. Private colleges also offer engineering in New Hampshire. Saint Anslem College offers an undergraduate program in an engineering, and the Ivy League school Dartmouth College provides undergraduate and graduate programs in engineering.
There are five community colleges in the state that offer associate's or certificate programs in engineering fields.
According to the U.S. Bureau of Labor Statistics (BLS), engineering jobs are expected to expand by 10% between 2010 and 2020. The BLS categorizes all engineering professions under the major occupation of architecture and engineering jobs. In May 2011, there were 12,230 total engineers across occupations in New Hampshire.
Chemical, biomedical, and health and safety engineers have the least amount of engineering jobs in the state. The BLS states there are under 100 workers in each of those three sectors. The engineering sectors that recorded the most engineers included mechanical, electrical, industrial, and civil engineers. Mechanical, electrical, and industrial engineering sectors reported employment figures in the thousands. The Manchester metropolitan region recorded the highest employment figures in the state.


Simple Masala enhanced with the richness and flavor of Coriander Leaves !
South Indian Style Tomato Coriander Masala, an awesome side dish for Idli / dosa and even for Rotis. Everytime we think of a side dish for Idli / Dosa, we end up doing the routine sambar, chutney or sometimes we take more interest to make something different like Kadappa or vada curry. This Tomato Coriander Masala is also one of the unique masala dish which goes very well not only with Roti but also with Idli / dosa.
Very simple to make gravy with just onions, tomatoes, coriander leaves and Indian spices. The coriander leaves add a great flavor to the whole dish. Adding coriander leaves not only adds flavor but also its good for health because we are including some greens as part of this recipe.We don't have any other rich ingredients like cashews or paneer etc. This South Indian Style Tomato Coriander Masala is so delicious and so tempting.
In a mixer jar, add coriander leaves, grated coconut, cumin seeds and green chilli and grind everything to a smooth paste.
Now, time to add tomatoes. Add tomatoes to the pan and mix well. Add 1 cup of water and cover and cook the masala in low flame for 10 mins. When the tomatoes are cooked well, switch off the flame.


Every day you can go visit the pumpkin king himself; Jack Skellington from Tim Burtons' The Nightmare before Christmas over in Frontierland with "Jack and Sally's Cemetery" with a scary photo-location with the most "frightful" view of the eerie Phantom Manor.
Are the villains too scary for the little ones? Well don't worry, as you can meet many of the original characters you love and adore around Main Street U.S.A! Every day you can meet either Minnie or that mischievous alien Stitch at Costume Corner in their Halloween costumes, over in Town Square you can visit Goofy with his Bonbon machine, or over by the boarding house you can say hello to that beautiful little kitten Marie with her cute orange bow!
Also don't forget to join the Dr Facilier and the other villains in the amazing night-time show; 'Disney Illuminations!' every night on Sleeping Beauty Castle.
Love the night of the 31st? Then come and celebrate with Mickey and the Disney villains during the Evening Soirée! From 5pm come dressed up as your favourite character, from Jedi to ragdolls, to princesses and more until the Witching hour of 1am and enjoy the eerie night time atmosphere of the Soirée! Meet Jack Skellington in Frontierland or meet Tiana and Naveen as they celebrate Mardi Gras style on this one-a-year night-time event! Come join the gang for a pirate show on the castle stage with Minnie and friends!
If you would like to book a spooktacular stay at Halloween, then call Holiday Hamster on 08000 988 955 where we can help you plan a magical trip to Disneyland Paris.


text:
Q: Silverstripe: Page Controller Redirect Back not working I have a controller (PromoCode_Controller) which is an extension of Page_Controller. When I fire an action, I'd like the page to redirect back to the page it came from. I currently have $this->redirectBack() set up, but it's not firing...
I have the Page_Controller defined in my 'config.yml' file:
Page_Controller:
  extensions:
    - PromoCode_Controller

The controller looks as such:
<?php

class PromoCode_Controller extends Extension {
    private static $allowed_actions = array(
        'DisplayCodes',
        'DeleteCode'
    );

    public function DisplayCodes() {
        //Display users promo codes
        $arrayList = ArrayList::create();
        $codes = PromoCode::get()->filter(array(
            "OwnerID" => Member::currentUserID(),
        ));

        foreach($codes as $code) {
            $arrayList->push($code);
        }
        return $arrayList;

    }

    public function DeleteCode() {
        $codeID = $this->owner->request->param("ID");
        //if($codeID && $code = PromoCode::get()->byID($codeID)) {
        //  $code->delete();
        //}
        echo $codeID;
        $this->redirectBack();
        return $this;
    }

}

I have a link in my template to delete the code from the DB. When I click the link, it prints the $codeID variable on a blank white page, but it doesn't fire the redirect.
Can someone help point out where I'm going wrong?

A: So I managed to stumble upon the fix by accident. Here is the complete code:
public function DeleteCode() {
        $codeID = $this->owner->request->param("ID");
        if($codeID && $code = PromoCode::get()->byID($codeID)) {
            $code->delete();
        }

        return $this->owner->redirectBack();
    }


text:
Events /Media
Laura's Notes from
the Handbasket
More Things On Heaven and Earth: Mysterious Radio
(Surreal sky)
Sometimes I think that without my husband and kids, my non-literary entertainment would probably be limited to book research, playing the piano, watching endless reruns of Poirot, Midsomer Murders, and listening to whatever non-comedic random radio show is playing on Sirius XM's Radio Classics (and I only have Sirius because it came with my car, and who knows how to discontinue it…). Husband has a voracious mind. He's an early adopter of every kind of technology, and has an encyclopedic knowledge of films, film history, and literature. As soon as podcasts became a thing, he was listening to them. I stumbled along a couple of years later, but I still don't really know how to get feeds I don't listen to anymore off of my devices, including a Canadian one that puzzles me because I think it's supposed to be funny, but I don't get the jokes. That sounds kind of sad, doesn't it? No worries, though. My family keeps me well-supplied with popular culture. Though my son draws the line at my car-dancing to K-Pop in his car. But if he plays it while we are driving in mine, all bets are off.
Everyone in our family loves to hear a good story, no matter what the topic, no matter its veracity. It's one of the reasons I listen to radio drama, or talk radio when I'm in the car. I like narrative. Narrative frames the world in ways that help me understand it better.
Our latest enthusiasm is a podcast called Mysterious Radio. Maybe sometime in the last few decades you heard Art Bell's Coast to Coast AM overnight radio program (current version now hosted by George Noory). It always had a wide scope of subjects and guests. Everything from world events to space anomalies, alien abduction stories, conspiracy theories. Listeners could call in and were allowed to share their own stories. Mysterious Radio is different in that the podcasts are primarily pre-recorded interviews with a single guest (or pair of guests, in at least one case).
The show is hosted by a woman named K-Town, a wildly gracious, butter-voiced veteran of the U.S. Army's 10th Mountain Division. But as wonderful as her voice is to listen to, she talks little during her interviews, rarely interrupting her guest after she asks a question. It's refreshing when a host doesn't work to occupy the spotlight. She is also astonishingly agreeable with her guests–and they often have outrageous things to say. She only responds with, "amazing," or "that's incredible." She never condescends or editorializes. Sometimes I'll find myself laughing out loud, or saying, "that's insane," or "no freaking way that ever happens." But K-Town is always encouraging, cool, and polite.
In any given episode, there are usually several "no way that happened" moments. Here are a few of the episode titles: The Shocking Truth: Hollow Earth; Plan to Enslave the World; Ghost Lights, and Vanishing Into Thin Air; Alien Antichrist; A Family Tormented (Tennesee's Bell Witch); The Great Deception–Flat Earth; No One Died at Sandy Hook (and other false flag events).
Yes, you read that right. No One Died at Sandy Hook. All the other stories have their share of exotic oddness, but the Sandy Hook story made me feel almost sick to my stomach because of the violence of the subject matter. I gather there are questionable pictures online and spokesperson statements on which the guest based his theories. But the whole story is so repellent that I found it very hard to listen to. I did finish, though. It's the only episode that provoked such a reaction from me. The rest have been fine.
Mostly I listen for the stories. My favorites are, of course, stories about hauntings. I've done plenty of book research about how spirits ostensibly operate, but by listening to these programs I've become more adept at putting together the language and disparate theories. Also, I don't worry so much anymore. Spirits aren't particularly organized, and I refuse to have a Ouija board. There are common elements to all the ghost stories: cold spots and trances, objects lost or out of place, the possible attachment of a spirit to a person or family.
Right now I'm listening to the first Hollow Earth Theory show. Both Hollow earth and Flat Earth stories show up frequently, as do alien abduction stories. But along with ghosts, I'm particularly fascinated with theories of multiple dimensions. Though the idea of there being an infinite number of universes, meaning infinite numbers of you and me, makes me a little nervous.
There are many things I like about this show, and others like it. I love the connections that people make. They take stories and legends and experiences from all over the world and put them together in fascinating ways. The facts and suppositions and theories live side-by-side, stitched together by enthusiasm and (sometimes ostensible) rationale. Even though some of the interviews cover dark subjects, the guests often shine with passion. And if that passion looks a little like madness, does it matter? We are all passionate about something. Only some people are braver about sharing theirs.
What about you? Do you enjoy tales of mysterious things?
March 28th Words
Journal: 0 words
Long fiction: (Edited 70 pages, printed out 420)
Short fiction: 0
Non-fiction: 0 words
Blogging: 875 words
Exercise: 90 minutes exercised bike
3 thoughts on "More Things On Heaven and Earth: Mysterious Radio"
skyecaitlin says:
Wonderful photo, Laura: I am NOW trying to find Mysterious Radio on AM stations. I can pull most up on my PC while I work and in my car by preset. BTW, I adored Sirious Radio when it came with my car, but then it vanished and I'm not sure I want to pay for a subscription: it had many stations and music I adore ( classical, jazz, blues and rock and news stations, too, including EWTN). I adore tale of mysterious things and hauntings, but that's not unusual; I live in NJ close to the Pine Barrens—the place of the infamous Jersey Devil, and in our area, there are many haunted houses. I am also of Ukrainian descent, and my family came from the Carpathian Steppes, near where Prince Vlad's castle and grave are located, so tales of vampires and ghosts sometimes become more than tales.
Laura Benedict says:
I love that you're a kindred spooky spirit! The Pine Barrens are so mysterious–and New Jersey has a great gothic history.
If you go to the MysteriousRadio.com website and click on "Shows" you can go right to the episodes and play from there. I don't think she runs on AM. The website obviates any need for searching–and the recording quality is always top notch. Can't wait to hear what you think.
Pingback: Saturday Serendipity, 1 April 2017 - Laura Benedict
Get Your Notes Delivered!
(this will not add you to my newsletter list)
Select Month January 2020 March 2019 February 2019 January 2019 December 2018 November 2018 July 2018 April 2018 March 2018 February 2018 January 2018 December 2017
© Laura Benedict 2020


text:
layout: post
title: "Deploying A Flask App On Google App Engine's Standard Environment"
categories: [python, google_cloud]
tags: [GAE, google app engine, python, flex enviroment, standard enviroment]
image:
  feature: DOGAE.png
  teaser: DOGAE.png
---

# Background
I couldn't find an easy guide to follow other than the [google app engine's lengthy tutorial](https://cloud.google.com/appengine/docs/python/getting-started/creating-guestbook), so in hope of saving others a bit of time I made this nifty post. In this post I go over deploying a flask application in google app engines 'standard' environment and some potential pitfalls you might encounter on the way.

-----
# Google App Engine Environments
Google app engine (GAE) offers two possible enviroments, [standard and flex](https://cloud.google.com/appengine/docs/the-appengine-environments). The two enviroments are mostly the same however the flex enviroment has better library support and pricing model; note however the flex environment is still in beta and has significantly less tooling. Currently the google app engine's provided local dev server ([dev_appserver.py](https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server))  only supports the standard environment. Based on this I decided to release on the standard environment as I felt that it'd be faster to reach a working deployment if I could fail very quickly.

-----
# Step 1: Create an App ID
You'll first need to create an application on google cloud services which you can get to by going to the [main console](https://console.cloud.google.com/).
![](https://cdn.scotch.io/23785/d9IqCuxBREOkHnWceMBH_create%20project.png "Create Project")

-----
# Step 2: Enabling Services
You may need to enable various services before deploying. If you navigate to the consoles of the various services it should ask if you want the service enabled for your application
I enabled:
* [App Engine](https://console.cloud.google.com/appengine)
* [Compute Engine](https://console.cloud.google.com/compute)
* [Storage](https://console.cloud.google.com/storage)

-----
# Step 3: Setting up your local environment
For this next sections you probably want to make sure your using a virtual environment and produce the correct requirements.txt file. The final results will yield the relatively few files you need to add to work with google app engine. You'll also need to be sure you have the [SDK for App Engine](https://cloud.google.com/appengine/docs/python/download)
![](https://cdn.scotch.io/23785/Br3SxyLRr6KC0CDPwtxl_project%20layout.png "Required Files For GAE")

**Creating Configuration File (app.yaml):**

The app.yaml file describes properties on how to handle routing and the deployment your application.
```yaml
# app.yaml
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: main.app

#[START env]
env_variables:
	CLOUD_STORAGE_BUCKET: khet-online-storage
#[END env]
```

The runtime argument is always python27 for standard environment.
The handlers are used for routing to different components (e.g. [static content](https://cloud.google.com/appengine/docs/python/getting-started/serving-static-files)).
Specifically for my site everything is routed to my main.py:
```python
import ...
# Google App Engine will look for this variable (".app" in handler)
app = Flask(__name__)
```

If your using cloud storage in your app you can specify the "CLOUD_STORAGE_BUCKET" environment variable and that's what libraries the [ndb](https://cloud.google.com/appengine/docs/python/ndb/) will use as the default bucket.

**NOTE**

When I was making my app.yaml assumed the allowed properties were the same regardless of which environment your deploying into.

This caused the extremely nondescript error:

```bash
	Updating service [default]...failed.
	ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The request is invalid.
```
Many wasted hours because the key "env" is required when deploying on flexible environment, but not allowed when deploying on the standard enviroment. Below is an example of the app.yaml for the flex enviroment.

```yaml
# app.yaml for flex enviroment
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 2

handlers:
- url: /.*
  script: main.app
```

**Adding Libraries And Dependencies:**

Unlike the flex environment the standard environment won't use your requirements.txt
Instead you must bundle the required libraries in a folder. When you create the appengine_config.py file in your root folder you can configure additional locations for where to find requisite libraries.

I used "**pip install -t lib -r requirements.txt**" to save all the required libraries to a deployable folder
 Further instructions can be found [here](https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_third-party_library)

Technically you can[ add specific libraries in your app.yaml](https://cloud.google.com/appengine/docs/python/tools/built-in-libraries-27) but I was already so skeptical that I figured I avoid the frustration by just loading all my required files with the mechanism I knew to work.

-----

# Step 4: Local Testing
**Setting up gcloud:**

If this is the first app your setting up you should run:

`gcloud init`

You'll get a prompted to set default regions, email address, and project id.

You should also set the default project with:

'gcloud config set project `<Your Project ID>`

You should also login with:

`gcloud auth application-default login`

I had some weird threading bug on my client and the recommended fix was running:
gcloud config set app/num_file_upload_processes 1
Once that's set up you can run your app locally using 'dev_appserver.py :

`dev_appserver.py --port <port num> <path\to\your\app.yaml>`

** NOTE **

I had trouble with all flask versions greater than 0.10.2 as the dependent library "click" fails to work with the local server, so I decided I could live with a lower version of Flask.....

-----

# Step 5: Deploying
Once you've fixed all the kinks in your local environment you can deploy by using:

`gcloud app deploy app.yaml`
I had problems with some of my files not getting deployed so you may need to change the [standard skipped files](https://cloud.google.com/appengine/docs/python/config/appref#skip_files).

![](https://cdn.scotch.io/23785/YbjzXEiTyardmcasYbJq_console.png "What it should look like if things work.....")

**NOTE**

If you end up with the message "**INVALID_ARGUMENT: The request is invalid.**" validate your app.yaml is correct, as there is less stringent validation of this file when testing using the local server.

-----

# Going Past Deployment
Originally google actually offered a service to deploy directly from your repository but they deprecated this feature. I find this particularly sad because that's one of my favorite features offered by competitors like elastic bean stalk. It's especially aggregating as it wasn't always clear on app engine what files were going actually to get deployed, as by default app engine skips various files (e.g. those beginning with "." or ending with ".pyc")

An alternative is to use Travis CI's to trigger an app cloud update after a success build.
https://docs.travis-ci.com/user/deployment/google-app-engine/


Here, in Perth, we absolutely adore outdoor living. It's an aspect of life that we don't take for granted in any way at all. In fact, we embrace it! At any given time, if you don't find us in our homes or at work, we can be found out enjoying our gardens. And, because our outdoor spaces are so important to us, it stands to reason that our landscape designing needs to be perfect too.
Creating the right vibe in your garden takes a great deal of planning and thinking. You need to work with a landscape designer who understands you. You both need to feel comfortable enough to communicate effectively together. By sharing your ideas and thoughts, you will be able to get some great feedback and perhaps some landscaping knowledge that is completely new to you.
So, how do you find the right landscaping design Perth professional for your project?
To achieve the best landscape design, Perth people need to focus initially on deciding what they want to achieve. What do you wish to use your garden for? Would you like to create a herb or veggie garden? Perhaps you would love a water feature to enjoy. The best thing to do when you're looking for outdoor space ideas is to take a look online, around your neighbourhood or at magazines and collect the ideas you like. If you're feeling artistic, sketch out a design for your yard so you can discuss it with the professionals.
It's a good idea to discuss your ideas with a few landscapers until you figure out what one you can work best with. Communication is key when it comes to deciding what you want from your landscaping design Perth. So, once you have a few ideas in your mind, compile a list of companies in your area. If you see a yard that you like, stop and ask who designed their landscaping. They'll appreciate the compliment. Also, speak to your neighbours and friends. Narrow your list down to a handful of landscape designers.
A great landscaper needs to have a proven track record that illustrates their results and talent. Other aspects to look for include reliability, transparent pricing, in-depth knowledge of their field, professional attitude, attention to detail and working within budget.
It's a good idea to ask the final contractors who have made your shortlist to provide you with some checkable references. Don't feel that you need to make any on-the-spot decisions. Any good landscaping company will never try to hurry you to come to a decision nor will they pressurise you into choosing them.
So, if you're ready to find out more about our landscaping services, contact the team for a quote today. We guarantee you a service that's second to none, leaving your yard looking amazing all year round.


At Grafton Primary school we are following Collins 'Snap Science' as our scheme of work. This scheme is based on using practical examples and real life experiences to extend our scientific knowledge and understanding. We place great emphasis on using scientific vocabulary in class and completing student led enquiry investigations. We have a school's principle of science document which outlines our philosophy at Grafton Primary. This document was created by both students and teachers.
Science encourages active learning, practical investigations and lots of fun. Children can ask a question, make predictions and decide what to do next. At Grafton we show care and concern for all living things.
Click here for an overview of the Science topics taught throughout the school.


A good trading strategy would be to wait until next year!
Greetings from New York, where, if, as the Oracle of Omaha says, each price tick is a "pitch" from Mr. Market, I'm Eddie Gaedel, the 3-foot-7-inch pinch hitter for the St. Louis Browns who took four straight pitches in the Majors, got to first base, then never played again.
For what it's worth from a guy who just compared his home run potential to a guy who weighed 50 pounds, I don't see a heck of a lot of pressure to the downside. Anecdotally, I know a lot of folks who are leaning short (no pun intended) and just as many traders who are playing a lot of catch up with the year-end looming. Put it together and I end up with a slightly higher bias, no conviction and absolutely no illusions about the fundamental case for buying stocks for the long term.
Target (TGT) down on word that it expects a "promotional holiday season". Walmart (WMT), which kicked off the promotions for the 2009 holidays last week and does so every year, is higher based on Berkshire Hathaway (BRK.A) increasing its stake. See also Translating Buffett's Latest Bets. I'm not regarding the moves in either name as much more than bored stock jockeying. The holidays are going to be promotional. Make a note of it.
Saks (SKS) a bit higher on a squishy earnings beat, despite lower sales. The once high-end chain sees customers focused on value and is managing inventories tighter. I have a decent range of knowledge regarding the retail industry and can't think of a single one that isn't seeing value-focused customers and tightening inventory.
Where do all these retail belt-tightenings end up? One store selling size large white T-shirts, one pair of size 10 shoes, and some draw-string pants. We will then have gone full circle, all the way back to Henry Ford's "any color as long as it's black" business model.
Speaking of which, honk your Chinese-brand car if you're kicking yourself for not buying Ford (F). All the benefits of Government Motors stimulus with none of the politico managers.
For what it's worth, and to end our chat on a positive note, I'm still long Disney (DIS), the USO ETF and Gold via the GLD. Also some Nordstrom (JWN), as I like to listen to a piano while buying my white T-shirt and toe-jamming size 10 shoes.


Select any color from the palette to use for the border. For a wider selection of colors, click the "More Colors" link. After selecting a color, click anywhere on the worksheet to see how your border looks around the cells you highlighted.... Excel 2013 :: Change Cursor Colour? Apr 14, 2014. how to change cursor colour in excel 2013. using Control PanelEase of AccessEase of Access CenterMake the mouse easier to use does not work as it will change mouse instead of cursor colour in excel 2013.
Solution. To resolve this issue, you will need to change the color of the pointer to a different color. To change the color of the pointer, use the method below that corresponds to your version of AutoCAD®.
Excel 2013 :: Change Cursor Colour? Apr 14, 2014. how to change cursor colour in excel 2013. using Control PanelEase of AccessEase of Access CenterMake the mouse easier to use does not work as it will change mouse instead of cursor colour in excel 2013.


text:
The Gyalwang Karmapa Arrives in Europe for His Third Visit
18 May 2016 -Geneva, Switzerland
During the late afternoon the Gyalwang Karmapa touched down for the first time at the Geneva airport in southern Switzerland with its soaring Alps. The Karmapa was formally received by Ringu Tulku Rinpoche, President of Karmapa Foundation Europe, Ngodup Dorjee, the representative of His Holiness the Dalai Lama, and Sangye Dorje, the President of Rigdzin Swiss Association, which is organizing the visit.
After this warm reception, the Karmapa and his entourage proceeded via motorcade to his hotel where Namkha Rinpoche, his followers, and the local Tibetan community joyously greeted the Karmapa in a traditional welcome with a sea of colorful brocade banners, pulsing drumbeats, and long white scarves undulating in the wind. At the edge of the driveway, a great umbrella of golden silk awaited the Karmapa to accompany him as he stepped from the car and walked through a corridor of well-wishers into the hotel.
On Saturday May 21 and Sunday May 22, the Karmapa will be teaching at the Theater of Geneva (Théâtre du Léman) on the topic of meditation and the source of inner peace. On Sunday morning, he will bestow a Medicine Buddha empowerment. A few tickets are still available here.


text:
in the dark but have light background, detectable profile
By Thrashaero, February 3 in The Dark Mod
Thrashaero 0
Location:Illinois
Interests:controversy, women who aren't nuts, RC planes and helis, guns, useful gadgets, motorcycles/bikes. video games: niche FPS's/mods (PR, FH2, RS2), flying, racing, space sandbox/survival, melee
I was thinking one major flaw of thief is that you can be in a dark area, but even if there's a lighted area behind you, the enemies can't see you. I always thought this was a bit cheesy. maybe a bit hard to deal with in a game, maybe hard to program, but i think it would really add to the realism if the enemy can see your profile even if your light gem is completely dark, because of the background behind you would highlight your shape and movement.
jaxa 201
I agree. We've all seen it, in Thief and TDM. In some cases it could be explained away by light sources appearing brighter than they really should be (due to world ambient, your own gamma settings, etc.)
It could be hard to program, and it might make the game significantly more difficult (for better or worse). It could also "break" existing missions by making them too hard to play.
Edited February 3 by jaxa
peter_spy 1172
Location:Central Europe
Interests:Photography, 3d modeling, level design
We've already discussed it several times, it's a poor design decision and basically punishing the player for something beyond his control, resulting in frustrating trial and error gameplay.
Builder Compound Asset Pack – models and textures for TDM
As Judith said, we've discussed this several times. Implementation would prolly break some missions, and lead to other related requests, all of which have been discussed to death and tossed. Implementation would be difficult, in that you'd have to ray-trace from the AI's eyes to all visible lit areas, whether the light source is visible or not, and testing whether any part of the player blocks any of the rays. That's a big chunk of time.
duzenko 481
Think of it as some sort of voodoo magic making the player actually invisible when in the shadow rather than blending in with the black background. Otherwise you quickly stumble in the opposite problem: if player is fully occluding the light source to AI view AND there's no background at all (think sky or totally black surface), your logic should make him invisible but in the game that would keep your lightgem still lit.
Technically parsing profile scans is a non-trivial task, especially in real time. And what about the camouflage?
Even if the tech would be there performance-wise, what's the point in terms of gameplay? You'd either make the player frantically look behind all the time, or you'd have to introduce some sort of other light gem, a kind of silhouette detection meter.
Edited February 3 by Judith
OrbWeaver 416
but i think it would really add to the realism if the enemy can see your profile even if your light gem is completely dark
Exactly. The whole point of the light gem is that it tells the player how visible they are to AI. If there are whole load of other visibility criteria that are not reflected in the light gem, why bother having a light gem at all? You might as well just force the player to guess whether they are visible based on the behaviour of AI, or constantly rotate on the spot to figure out whether they might be visible from a particular direction.
DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
Instead of having a second indicator, maybe you just brighten the light gem in response to having your silhouette being detectable (if a % is assigned to each, you pick the current larger one and have that be the light gem brightness). Meaning it's a bit harder in some situations to find the sweet spot where the light gem will dim. Or many situations, if that turns out to be the case.
A lightgem is based on AI position quickly becomes useless. You might be visible to one AI but not to the other, so either you're getting incorrect readings or you try to average it out. Either way you're no longer getting useful information.
Unless someone finds a brilliant non-cycle-stealing method of spotting a backlit player, talk about second indicators etc. is nonproductive. As we've said, this could break missions and has been discussed to death in the past.
New Horizon 467
It's a game. It's meant to be fun, not a perfect simulation of reality.
Abusimplea 136
At least Thief Gold seems to have a simplified light source occlusion detection. I played it recently and noticed that a small area of the light gem sometimes turns yellow or even red while in shadow and near some light sources.
I didn't know it was discussed since I don't see a search function available. "Punishing the player" would only happen if it's implemented across the entire game instead of an option to toggle. "frustrating trial and error gameplay." is already in the game depending on the difficulty and if the player hates the difficulty.
I was thinking just areas in which you would cast a shadow, where the shadow would cross the path of the AI detect field, you're detected. Just as simple as being detected under direct light, you're detectable by light that is behind you. I don't see why it would be extremely ridiculous to implement but i'm no programmer.
"What's the point in terms of gameplay?" I dunno, realism, challenge...pretty obvious I would think. It wouldn't have to be for absolutely every angle everywhere, just areas where I feel like I should be easy to spot due to my profile being obvious despite the fact I might be in the shadow of something else, there's a lot of times there's bright light behind me that would make me easy to see. It's just something I find rather noticeable.
You mean, observing the backlit areas and where the ai is viewing, something like a master thief would actually try to do? If this were implemented I'm pretty sure a light gem of any sort would be unnecessary and is already able to be turned off.
it wouldn't be needed if one just observes the ai and knows what light source is behind them that they would likely intersect.
wow, a game? you're right, simulating reality couldn't possibly provide any sort of fun.
Edited February 6 by Thrashaero
This is closer to what I was thinking. Something fairly simple, not some real time profile raytracing HD clusterf** of programming. Just something to make the areas where you would be obviously visible against a lit background a little less easy to just waltz through....but what do i know...it's been discussed to death and must be put to rest.
Mappers can use entities and scripts to alter your lightgem behavior so that's already a thing.
This discussion is a about a universal property of silhouette detection.
While I'm not a fan of the idea...
I did think of a "solution".
If the lightgem value is < X
Relocate the AI eyes to the player origin keeping the same trace vector angle as AI to Player
Trace from that location to the closest light origin in the same vector direction
Relocate the lightgem to the incident location within the light radius of the closest light origin
where the original AI to player vector intersects the light origin to player vector
Capture lightgem value
Illustrated for clarity:
In essence you are temporarily moving the player backwards along the trace vector until
they intersect with a light radius.
It's not free but it's not monstrous either.
If someone made a tech demo, I'd play it but... as I said... I'm not a big fan of the idea
so I wouldn't bother to work on it myself.
"What's the point in terms of gameplay?" I dunno, realism, challenge...pretty obvious I would think.
It's everything but obvious. Realism is never a point in games, not in gameplay design, except for simulators, and even that has its limits. I don't know why so many people don't get that. Maybe because they don't get to practical side of making content. You need realistic lighting, models, textures and materials, but both in games and movies they're used to create fantasies. You need realism only to be grounded in most basic ways humans see objects, but that's mostly it.
Gameplay needs to be a simple and elegant concept, IMO ideally it's easy to learn, but hard to master. And depending on what you're trying to say with your game, it should also be fun, so I guess in most cases. There's no fun in constantly watching yet another indicator on the screen, or turning around frantically every half a minute. The game is a variation (or rather slight subverstion) of a power fantasy, where you're a sneaky type that's fragile but quite smart, somewhat athletic, and invisible in shadows. The thing that stands out the most is feeling smart and cunning, and that's what core design and level design should support the most. Suggesting features like the above is anything but.
Obsttorte 1439
Scripting guru, Mapper
I didn't know it was discussed since I don't see a search function available.
"Punishing the player" would only happen if it's implemented across the entire game instead of an option to toggle. "frustrating trial and error gameplay." is already in the game depending on the difficulty and if the player hates the difficulty.
I don't see why it would be extremely ridiculous to implement but i'm no programmer.
just areas where I feel like I should be easy to spot
If this were implemented I'm pretty sure a light gem of any sort would be unnecessary.
Upper right corner, the field with the string search in it
that's mission related issue, not a problem with the core game concept
so you answered it on your own
and if the mission authors are interpreting this in different manners, what is very likely, you'll get unpredictable and ununiform gameplay across the game, perfect. Not to mention that as per your suggestion mappers would have to define those spots where this behaviour should be applied. Sounds tiresome.
whether it is neccessary in the current configuration is discussable either (hence it is toggleable), but despite that it doesn't sound like you are making this propose to reduce the hud
this is wrong. You visibility in real life, as this is what you are seem to be referring to, doesn't only get affected by the brightness of the area behind you. Normally the major impact comes from the lights that is hitting you, independent of its origin, may it be behind or in front of you. This is what the current implementation is based on, as it is in almost all other stealth games, and it seems to work out pretty well.
Besides the fact that sarcasm really won't help you motivating any of the team members to apply any of your suggestions, you didn't get the point. Noone says that simulations can't be entertaining, I for one love playing them. The point is that TDM isn't a simulation. Of course you can go on and create a thiefing simulation that aims to reproduce reality, but that has never been the goal of TDM.
Something like this can easely be applied by mappers by placing additional light sources in that area that only interact with the players lightgem. The player can't see it, but it lights him up. I don't see how this is closer to what you were thinking, though, as you are talking of silhuettes and background brightness, so visibility that depends on from which direction the player is looked at, which won't apply here in any way.
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist:
Texture Blending in DR: DR ASE Blend Exporter
End of shameless self promotion.
Asking questions that have already been asked is pretty hard to avoid when you join a forum that has been around for fifteen years.
I'd personally rather see conversations than have a bunch of people quietly doing searches and never posting.
There have been times where I have cringed at the ability to walk down a well-lit hallway but be invisible to guards because there is a thin strip of shadow right in the middle. I've sometimes thought it would be nice to have a more realistic way of hiding in the shadows. Unfortunately, the technical limitations are just too daunting. Not necessarily the programming, but the gameplay implications.
In real life you have a much wider field of vision than you do in the game. Your peripheral vision can detect light, allowing you to tell with a quick glance over your shoulder whether there is light behind you or not. In the game, you cannot do this, and would be forced to spin nearly 360 degrees in order to tell what is behind you. If an AI is walking past you, you will have to constantly be rotating to figure out whether you are between him and a light. This is not going to be very enjoyable for the player.
Since AI can relight or carry lights, players have no way of knowing whether a light might suddenly appear far down the hall behind them, causing their profile to be visible. This punishes the player for something that is essentially out of their control, which is bad for gameplay.
In real life you can do dozens of things to change your profile, including going prone. TDM provides only one option, crouching. Adding extra movement options would open a big can of worms that would drastically change TDM gameplay.
The fact that the lightgem would no longer give the player accurate information on how visible they are has already been mentioned.
HMart 202
This is one of the requests that I personally think is not a good one even tho may sound like a good idea, Springheel and others already said the problems with it, so I will not bother saying them again, I will only suggest that if the TDM team doesn't implement something you want, because they decided is not worth it and you really think it is, then TDM is a open game with a open source engine so anyone is free to implement the ideas they want and release them has unofficial mods to TDM, just my two cents.
Edited February 7 by HMart
If you're expecting the development team to totally change the stealth system into something where the light gem is useless and might as well just be removed, and where players are required to constantly look behind them and try to guess whether they are visible to one or more AI — forget it.
If you personally feel that such gameplay would be fun, you're welcome to that view, and maybe others agree with you. You can try to simulate this by turning the lightgem off, which as you have observed is already an option. But if you want this to be part of the core mod, you're probably going to have to develop your own fork. The objective of this mod is to provide gameplay which is similar to, and inspired by, the original Thief games, of which the lightgem-based stealth approach was an iconic component. Core aspects of the game are not simply going to be thrown out or rendered obsolete in the name of "realism".
It's pretty clearly not going to pass just by popular demand, but it'd be an interesting mechanic to see since it regularly comes up as an idea. Ideally it'd be better if it could be pulled off by script so you wouldn't have to fork the sourcecode; then you could release it as an FM and people could love it or hate it, but it'd get it out there in a form people could easily see it.
If it requires a change in the sourcecode, then it's something you can do for yourself and you could share the code so that other like-minded people could use it for themselves, but not beyond that. But it'd make people that want to have it happy anyway.
Long story short, I think this is the kind of change you should try to do yourself, or find someone that knows how to code that shares your thinking, if you want to see it happen. I mean it's a good incentive to learn coding if you haven't already. I did just to have something I wanted to see in this game...
stgatilov 550
Lead Programmer
Location:Novosibirsk, Russia
I don't think this would cause constant looking back.
Good players (at least in FPS) have some area awareness.
They have a brief look over the scene and as long as it does not change they know what is where.
Just like the goalkeeper knows where the goal is.
As for implementation, the most right one would be to render AIs view with and without player and compare them pixelwise.
Optimized approach would render player's mesh first, then use it as stencil while drawing the rest of the world. Various rectangle/depth-range optimizations included.
Of course, it should go low-resolution, with simplifications, in parallel, with huge interleaving (nobody needs 15ms-reacting guards anyway), etc.
In theory this could work well, but it has to be very well optimized.
Speaking of ray tracing, it is very similar, but instead of rasterizing AI's view on low resolution, raytrace it on even lower resolution.
Shoot rays to several key points of the player mesh (drop rays out of AI's view frustum), let the rays pass through player until first obstacle.
If it is farther than player, then check player's lightgem value against intersection point light value.
The light value of intersection point can be computed like in classical Whitted raytacing: cast shadow rays to all light sources, check for shadow and compute intensity.
While it will probably be faster, it would be hell trying to make the raytracing solution coherent with rendering.
As far as I know, there was an attempt to implement lightgem via ray casting, but it never worked robust enough to replace the graphical solution.
I think the problem with ray casting lightgem ( tdm_lg_weak ) is it has no access to the 1D+2D light projection textures
and if it did have that access it would still be pretty slow to parse them.
I guess you could downsize the textures prior to parsing them though.
I spoke on this topic before and proposed the idea of making a texture to lookup table converter
that would do something akin to down-sizing the textures along with stripping color data.
RPGista 598
Location:Brazil
Interests:Architecture, Arts in general, creating stuff.
stgatilov - Really interesting to know how it could work in a technical way!
Ive complined about this issue as well in the past. Like Springheel said, Ive also cringed as I followed a narrow shadow path between lit areas, right in front of guards, without being seen. I mean, the whole issue is basic common sense:
Like pointed out, it "could" be done. You could have stgatilov's system, a lightgem that lets you know that you are in shadows + from which direction your profile is visible agaisnt the background. But like a lot of guys have also said, its a game. You gotta draw the line somewhere. Simplify things in order to create a certain gameplay mechanics. Mappers could also minimize this flaw with good design. Its not something that you notice often, thats very grating. I guess resources are probably better used in other aspects of the engine.
I wouldnt mind seeing this working in a concept map, though.
Edited February 7 by RPGista
Most FPS games only require you to be on the lookout for enemies (which already requires lots of spinning around). TDM players also have to be aware of types of floors, the amount of light currently hitting you, and the direction AI are currently looking and moving. That's a lot of mental overhead. To also keep track of what is behind you, especially since "behind you" changes when either you OR any AI moves, would be asking a lot.
This would make an interesting experiment though. You could show a video where the player turns 360 for a view of the environment he is in, then have the player move around briefly and then have 2 AI enter the scene. Let people vote on whether they think the player would be silhouetted or not.


Variable Air Volume or VAV Boxes is the most common method employed in commercial/institutional buildings and is both an effective and economical means of temperature control by Regulating the Air Flow.
The simplest VAV system controls air from a single supply duct and varies the airflow to each zone or room based upon the temperature in the room.
In some instances, these components are combined. For example, a Smart Thermostat can combine the functions of a Temperature Sensor and a Controller.