Пример #1
0
/*--------------------------------------------------*/
void NOMAD::Eval_Point::display(const NOMAD::Display &out , bool in_block) const
{
    if (in_block)
    {

        std::ostringstream oss;
        oss << "#" << _tag;
        out << NOMAD::open_block(oss.str())
            << "x    = ( ";
        NOMAD::Point::display(out , " " , 2  , NOMAD::Point::get_display_limit());
        out << " )" << std::endl
            << "F(x) = [ ";
        _bb_outputs.display(out , " " , 2 , NOMAD::Point::get_display_limit());
        out << " ]" << std::endl;
        if (_h.is_defined())
            out << "h    = " << _h << std::endl;
        if (_f.is_defined())
            out << "f    = " << _f << std::endl;
        out.close_block();
    }
    else
    {
        display_tag(out);
        out << " x=( ";
        NOMAD::Point::display(out , " " , 2  , NOMAD::Point::get_display_limit());
        out << " ) F(x)=[ ";
        _bb_outputs.display(out , " " , 2 , NOMAD::Point::get_display_limit());
        out << " ]";
        if (_h.is_defined())
            out << " h=" << _h;
        if (_f.is_defined())
            out << " f=" << _f;
    }
}
Пример #2
0
void display_ios_tags(u8 *buf, u32 size) 
{
	u32 i;
	char *ios_version_tag = "$IOSVersion:";

	if (size == 64) 
	{
		display_tag(buf);
		return;
	}

	for (i=0; i<(size-64); i++) 
	{
		if (!strncmp((char *)buf+i, ios_version_tag, 10)) 
		{
			char version_buf[128], *date;
			while (buf[i+strlen(ios_version_tag)] == ' ') i++; // skip spaces
			strlcpy(version_buf, (char *)buf + i + strlen(ios_version_tag), sizeof version_buf);
			date = version_buf;
			strsep(&date, "$");
			date = version_buf;
			strsep(&date, ":");
			printf("%s (%s)\n", version_buf, date);
			i += 64;
		}
	}
}