Ahoj,
jak v androidu udělám nějaký seznam odkazů aby při kliknutí, každý zavolal nějakou funkci s jiným argumentem?
Ahoj,
jak v androidu udělám nějaký seznam odkazů aby při kliknutí, každý zavolal nějakou funkci s jiným argumentem?
Ahoj, toho jsem si všiml včera také ale není to tím, bohužel.
ahoj,
už nevím, kde hledat chybu - vždy při kliknutí na button Přihlašte se app spadne.... Kde je prosím chyba?
kód fce
public void log(View view) throws Exception
{
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://www.docasne.com/java.php");
List<NameValuePair> pairs = new ArrayList<NameValuePair>();
pairs.add(new BasicNameValuePair("key1", "value1"));
pairs.add(new BasicNameValuePair("key2", "value2"));
post.setEntity(new UrlEncodedFormEntity(pairs));
HttpResponse response = client.execute(post);
}
kód buttonu
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="-200dp"
android:layout_marginTop="200dp"
android:onClick="login"
android:text="@string/blogin" />
do souboru AndroidManifest jsem přidal tyto dva řádky:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Ahoj,
jak pomocí nového facebook graph api 2.0 zjistím události co uživatel provedl (komentáře, nahrané obrázky) ... ? Popřípadě lze získat seznam jeho přátel?
Ahoj, proč vždy pole pom má jen velikost 1??????
namespace knihovna
{
public partial class Form1 : Form
{
int i = 0;
string soubor = "knihy.txt";
List<string> _items = new List<string>();
public Form1()
{
InitializeComponent();
_items.Add("Autor");
_items.Add("Dílo");
_items.Add("ID");
lb_hledani.DataSource = _items;
FileStream osoubor = File.Open (soubor, FileMode.Open);
StreamReader cteni = new StreamReader(osoubor, Encoding.Default);
StreamReader cteni1 = cteni;
var file = cteni1.ReadToEnd();
var lines = file.Split(new char[] { '\n' }); // big array
var count = lines.Count();
string[] autor= new string[count];
string[] dl = new string[count];
string [] pom; //= new string[count];
string[] id = new string[count];
while (i<count)
{
string str = lines[i];
pom = str.Split (new string[] { "," }, StringSplitOptions.None);
autor[i] = pom[0];
dl[i] = pom[1];
id[i] = pom[3];
i++;
tbx_ukaz.Text = "ahoj";
}
MessageBox.Show("ahoj");
}
Ahoj, potrebuji převést čísla že soustavy která je menší než 10tkova a pak z desitkove do libovolné která je též menší než 10tkova, jak na to prosím?
takhle nemohu na to nějak přijít, nevím jak to sladit....
mam formulář do kterého můžeš napsat text i s českými znaky, pak je skript, který ho zapíše do db v jaké podobě ho přijme, v databázy je sloupec typu text a celé to má kodování utf8_general_ci .... jak to mohu sladit aby to fungovalo, tak jak potřebuju? Nějak nejsem schopen to pořešit
A jak nastavím kódování u php, co zapisuje data do databáze?
dohledal jsem si toto:
function correct(x)
{
$("#i1").text(x);
$.ajax({
url: "/test_php/build_2.12_22_00/correct.php",
type:"POST",
data: "dat=text",
success:function(){
var cbs; //vrácená hodnota z php
$.get("/test_php/build_2.12_22_00/correct.php",function(data){
cbs = data;
alert (cbs);
});
}
});
}
ale z nějakého důvodu to nepředává data php scriptu
Ahoj,
potřeboval bych na základě eventu spustit kod/soubor php a předat jí data získané pomocí javascriptu
Jde to nějak?
Jak to myslíš? Já potřebuji změnit řádek v databázi což bez mysql asi neprovedu :/
A jaké pořadí má?
Já to mam u jiného svého skriptu který mění password a tam to funguje jak má ;)
Ahojky - píše to chybu resource id #2 - co dělám špatně?
<?php
$spass = $_POST["spec_pass"] ;
session_start();
$spass_ses = $_SESSION["sheslo"];
$om = $_SESSION["om"]; // old mail
$nm = $_SESSION["nm"]; // new mail
echo $
$con = mysql_connect("localhost", "****", "******");
mysql_select_db(elogin);
$return = mysql_query("SELECT * FROM `elogin` WHERE email = '".mysql_real_escape_string($om)."'");
$zaznam = mysql_fetch_array($return) or die ("nefunguje ".mysql_error());
$mail = $zaznam["email"];
if ($spass != $spass_ses )
{
echo "chyba 1";
break 1;
}
elseif ($om == $mail)
{
$a = mysql_query ($con, "UPDATE elogin SET ".$nm." WHERE email =".$zaznam["email"]);
echo 'email uspesne zmenen';
}
else
{
echo "chyba 2";
break 2;
}
if(!$a)
echo "chyba".mysql_error();
else
echo 'vse ok';
?>
A čím to spustím? Mam v pc nainstalované akorát complex web server což mi zatím ke všemu stačilo ... přípona by nebyl problém jen jakým programem to spustit?
Hele a když to udělám přes phpko na win - veme mi to ten soubor .exe / .bin ? Či co mam udělat proto, aby to šlo?
Kamarád potřebuje skript v bash napsal a nedávno sem si našel článek, kde lze psát v php a s menšími upravami je z toho bash script ... Potřebuji v něm si vzít nějaké data z programu který bych přeložil na daném serveru .... (psaném v c/c++) ...
Live verze nepadá v úvahu, ta mě taky napadla :/
Nemá smysl instalovat nic do win .... musel bych pak instalovat i podporu php, kterou novější linux má integrovanou tedy alespon nějaké distribuce ... A čistej linux si sem narvat nemůžu.
Základní linux by to umět měl ... A jakym příkazem to mam hodit? S linuxem moct zkušeností nemam.
A lze tedy nějak kompilovat na tom? či jak t mohu udělat? Webhosting mam takže umístit to na web by nebyl problém
A lze nějak na ten server uploadovat soubory? - Potřebuju tam skompilovat 2x programy v c++ a s těma pak pracovat pomocí bash
Na pc mam okna a na tabletu android a potřebuji někdě vyzkoušet skript v bash. Ovšem nemam možnost instalovat si linux .... Takže někde jen odzkoušet online bez stahování
Ahoj, lze nějak online pracovat s linuxem / napsat něco v shellu (bash) a pak to online otestovat?
je to tím heslem, že je v čísle ... když ho nahradím stringem, jde to .... - chyba je v $op zatím ...
nic to nevypíše jen nefunguje to ...
Proč dělá chybu a vypisuje jen nefunguje? Kde je chyba?
<?php
$op = $_POST["oldpass"];
$np = $_POST["newpass"];
$op = 1481590360;
$np = "uvmistr";
$con = mysql_connect("******", "****", "*****");
mysql_select_db(elogin);
$return = mysql_query("SELECT * FROM `elogin` WHERE heslo = '".mysql_real_escape_string($op)."'");
$zaznam = mysql_fetch_array($return)
or die ("nefunguje ".mysql_error());
$pass =$zaznam["heslo"];
if($op == $pass)
{
mysql_query( "UPDATE `elogin` SET `heslo` ='".mysql_real_escape_string($np)."' WHERE `heslo` ='".mysql_real_escape_string($pass)."'") or die ("nefunguje: ".mysql_error());
echo "hotovo";
}
else
echo "heslo se neschoduje ....";
?>
Ahoj, jak udělám aby můj script natáhl data z databáze, srovnal je pomocí indexu v db ... a pak vykreslil 4 na stránku tak, aby v dolním levém rohu bylo to s nejnižším indexem a s nejvyšším bylo v pravém horím rohu?
Načtení dat z db bych udělal nejraději pomocí cyklu while, uspořádal to do pole, to následně porovnal a pomocné proměné přiřadil hodnotu která odpovídá řádku s nejnižším indexem ... Ale jak na to vykreslení/vypsání?
tak nyní to píše:
||=== a, Debug ===|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o)||In function `ZN12wxStringBase5eraseEjj':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|418|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o)||In function `ZNK12wxStringBase4findEPKcjj':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|495|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o)||In function `ZNK12wxStringBase5rfindEPKcjj':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|542|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o)||In function `ZNK12wxStringBase13find_first_ofEPKcjj':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|589|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o)||In function `ZNK12wxStringBase12find_last_ofEPKcjj':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|618|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o):C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\string.cpp|650|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_string.o):string.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_object.o)||In function `ZN11wxClassInfo8RegisterEv':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\object.cpp|232|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\object.cpp|252|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_object.o)||In function `wxHashTable':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\include\wx\hash.h|344|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_object.o):object.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_list.o)||In function `wxListBase':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|157|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|157|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_list.o)||In function `~wxListBase':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|215|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|215|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|215|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_list.o):C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\list.cpp|256|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_list.o):list.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_window.o)||In function `ZN8wxWindow14wxCreateObjectEv':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|409|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_window.o)||In function `~wxWindow':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|578|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|578|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|578|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_window.o)||In function `ZN8wxWindow6EnableEb':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|727|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_window.o):C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\window.cpp|818|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_window.o):window.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_panelg.o)||In function `ZN7wxPanel14wxCreateObjectEv':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\generic\panelg.cpp|87|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_panelg.o)||In function `ZN7wxPanel10InitDialogEv':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\generic\panelg.cpp|139|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_panelg.o)||In function `wxPanel':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\include\wx\generic\panelg.h|33|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_panelg.o):panelg.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_frame.o)||In function `ZN7wxFrame14wxCreateObjectEv':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|145|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_frame.o)||In function `ZN7wxFrame6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|192|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_frame.o)||In function `~wxFrame':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|214|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|214|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|214|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_frame.o):C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\frame.cpp|336|more undefined references to `_Unwind_Resume' follow|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_frame.o):frame.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_ctrlcmn.o)||In function `ZN13wxControlBase16DoUpdateWindowUIER15wxUpdateUIEvent':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\ctrlcmn.cpp|145|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\common\ctrlcmn.cpp|146|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_ctrlcmn.o):ctrlcmn.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
\libwxmsw28d.a(monolib_msw_control.o)||In function `~wxControl|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\control.cpp|68|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\control.cpp|68|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\control.cpp|68|undefined reference to `_Unwind_Resume'|
\msw\control.cpp|159|undefined reference to|
\msw\..\..\src\msw\control.cpp|225|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_msw_control.o):C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\control.cpp|313|more undefined references to `_Unwind_Resume' follow|
:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0|
\libwxmsw28d.a(monolib_msw_button.o)||In function `ZN8wxButton14wxCreateObjectEv':|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_msw_button.o)||In function `ZN8wxButton6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelRK11wxValidatorS4_':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\button.cpp|196|undefined reference to `_Unwind_Resume'|
C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28d.a(monolib_msw_button.o)||In function `~wxButton':|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\button.cpp|206|undefined reference to `_Unwind_Resume'|
C:\BuildAgent\work\wxPack\wxwidgets\build\msw\..\..\src\msw\button.cpp|206|undefined reference to `_Unwind_Resume'|
)||undefined reference to `__gxx_personality_v0'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (5 minutes, 21 seconds) ===|
ano on mi ten řádek kde je chyba přímo ukáže akorát mě napadá - jelikož je to portable verze CB ... tak je tam 2x minigw ... zkusím upravit u obou...
pořád to ukazuje stejnou chybu :-) ikdyž to upravím na right1, right2 ... pořád to samé
ikdyž jeden z nich, je upravenej, pořád to blbne, tady je kód hlavičkáče ...
// The winbgim library, Version 6.0, August 9, 2004
// Written by:
// Grant Macklem (Grant.Macklem@colorado.edu)
// Gregory Schmelter (Gregory.Schmelter@colorado.edu)
// Alan Schmidt (Alan.Schmidt@colorado.edu)
// Ivan Stashak (Ivan.Stashak@colorado.edu)
// Michael Main (Michael.Main@colorado.edu)
// CSCI 4830/7818: API Programming
// University of Colorado at Boulder, Spring 2003
// ---------------------------------------------------------------------------
// Notes
// ---------------------------------------------------------------------------
// * This library is still under development.
// * Please see http://www.cs.colorado.edu/~main/bgi for information on
// * using this library with the mingw32 g++ compiler.
// * This library only works with Windows API level 4.0 and higher (Windows 95, NT 4.0 and newer)
// * This library may not be compatible with 64-bit versions of Windows
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Macro Guard and Include Directives
// ---------------------------------------------------------------------------
#ifndef WINBGI_H
#define WINBGI_H
#include <windows.h> // Provides the mouse message types
#include <limits.h> // Provides INT_MAX
#include <sstream> // Provides std::ostringstream
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Definitions
// ---------------------------------------------------------------------------
// Definitions for the key pad extended keys are added here. When one
// of these keys are pressed, getch will return a zero followed by one
// of these values. This is the same way that it works in conio for
// dos applications.
#define KEY_HOME 71
#define KEY_UP 72
#define KEY_PGUP 73
#define KEY_LEFT 75
#define KEY_CENTER 76
#define KEY_RIGHT 77
#define KEY_END 79
#define KEY_DOWN 80
#define KEY_PGDN 81
#define KEY_INSERT 82
#define KEY_DELETE 83
#define KEY_F1 59
#define KEY_F2 60
#define KEY_F3 61
#define KEY_F4 62
#define KEY_F5 63
#define KEY_F6 64
#define KEY_F7 65
#define KEY_F8 66
#define KEY_F9 67
// Line thickness settings
#define NORM_WIDTH 1
#define THICK_WIDTH 3
// Character Size and Direction
#define USER_CHAR_SIZE 0
#define HORIZ_DIR 0
#define VERT_DIR 1
// Constants for closegraph
#define CURRENT_WINDOW -1
#define ALL_WINDOWS -2
#define NO_CURRENT_WINDOW -3
// The standard Borland 16 colors
#define MAXCOLORS 15
enum colors { BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY,
LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE };
// The standard line styles
enum line_styles { SOLID_LINE, DOTTED_LINE, CENTER_LINE, DASHED_LINE, USERBIT_LINE };
// The standard fill styles
enum fill_styles { EMPTY_FILL, SOLID_FILL, LINE_FILL, LTSLASH_FILL, SLASH_FILL,
BKSLASH_FILL, LTBKSLASH_FILL, HATCH_FILL, XHATCH_FILL, INTERLEAVE_FILL,
WIDE_DOT_FILL, CLOSE_DOT_FILL, USER_FILL };
// The various graphics drivers
enum graphics_drivers { DETECT, CGA, MCGA, EGA, EGA64, EGAMONO, IBM8514, HERCMONO,
ATT400, VGA, PC3270 };
// Various modes for each graphics driver
enum graphics_modes { CGAC0, CGAC1, CGAC2, CGAC3, CGAHI,
MCGAC0 = 0, MCGAC1, MCGAC2, MCGAC3, MCGAMED, MCGAHI,
EGALO = 0, EGAHI,
EGA64LO = 0, EGA64HI,
EGAMONOHI = 3,
HERCMONOHI = 0,
ATT400C0 = 0, ATT400C1, ATT400C2, ATT400C3, ATT400MED, ATT400HI,
VGALO = 0, VGAMED, VGAHI,
PC3270HI = 0,
IBM8514LO = 0, IBM8514HI };
// Borland error messages for the graphics window.
#define NO_CLICK -1 // No mouse event of the current type in getmouseclick
enum graph_errors { grInvalidVersion = -18, grInvalidDeviceNum = -15, grInvalidFontNum,
grInvalidFont, grIOerror, grError, grInvalidMode, grNoFontMem,
grFontNotFound, grNoFloodMem, grNoScanMem, grNoLoadMem,
grInvalidDriver, grFileNotFound, grNotDetected, grNoInitGraph,
grOk };
// Write modes
enum putimage_ops{ COPY_PUT, XOR_PUT, OR_PUT, AND_PUT, NOT_PUT };
// Text Modes
enum horiz { LEFT_TEXT, CENTER_TEXT, RIGHT_TEXT };
enum vertical { BOTTOM_TEXT, VCENTER_TEXT, TOP_TEXT }; // middle not needed other than as seperator
enum font_names { DEFAULT_FONT, TRIPLEX_FONT, SMALL_FONT, SANS_SERIF_FONT,
GOTHIC_FONT, SCRIPT_FONT, SIMPLEX_FONT, TRIPLEX_SCR_FONT,
COMPLEX_FONT, EUROPEAN_FONT, BOLD_FONT };
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Structures
// ---------------------------------------------------------------------------
// This structure records information about the last call to arc. It is used
// by getarccoords to get the location of the endpoints of the arc.
struct arccoordstype
{
int x, y; // Center point of the arc
int xstart, ystart; // The starting position of the arc
int xend, yend; // The ending position of the arc.
};
// This structure defines the fill style for the current window. Pattern is
// one of the system patterns such as SOLID_FILL. Color is the color to
// fill with
struct fillsettingstype
{
int pattern; // Current fill pattern
int color; // Current fill color
};
// This structure records information about the current line style.
// linestyle is one of the line styles such as SOLID_LINE, upattern is a
// 16-bit pattern for user defined lines, and thickness is the width of the
// line in pixels.
struct linesettingstype
{
int linestyle; // Current line style
unsigned upattern; // 16-bit user line pattern
int thickness; // Width of the line in pixels
};
// This structure records information about the text settings.
struct textsettingstype
{
int font; // The font in use
int direction; // Text direction
int charsize; // Character size
int horiz; // Horizontal text justification
int vert; // Vertical text justification
};
// This structure records information about the viewport
struct viewporttype
{
int left, top, // Viewport bounding box
right, bottom;
int clip; // Whether to clip image to viewport
};
// This structure records information about the palette.
struct palettetype
{
unsigned char size;
signed char colors[MAXCOLORS + 1];
};
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// API Entries
// ---------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
// Drawing Functions
void arc( int x, int y, int stangle, int endangle, int radius );
void bar( int left, int top, int right, int bottom );
void bar3d( int left, int top, int right, int bottom, int depth, int topflag );
void circle( int x, int y, int radius );
void cleardevice( );
void clearviewport( );
void drawpoly(int n_points, int* points);
void ellipse( int x, int y, int stangle, int endangle, int xradius, int yradius );
void fillellipse( int x, int y, int xradius, int yradius );
void fillpoly(int n_points, int* points);
void floodfill( int x, int y, int border );
void line( int x1, int y1, int x2, int y2 );
void linerel( int dx, int dy );
void lineto( int x, int y );
void pieslice( int x, int y, int stangle, int endangle, int radius );
void putpixel( int x, int y, int color );
void rectangle( int left, int top, int right, int bottom );
void sector( int x, int y, int stangle, int endangle, int xradius, int yradius );
// Miscellaneous Functions
int getdisplaycolor( int color );
int converttorgb( int color );
void delay( int msec );
void getarccoords( arccoordstype *arccoords );
int getbkcolor( );
int getcolor( );
void getfillpattern( char *pattern );
void getfillsettings( fillsettingstype *fillinfo );
void getlinesettings( linesettingstype *lineinfo );
int getmaxcolor( );
int getmaxheight( );
int getmaxwidth( );
int getmaxx( );
int getmaxy( );
bool getrefreshingbgi( );
int getwindowheight( );
int getwindowwidth( );
int getpixel( int x, int y );
void getviewsettings( viewporttype *viewport );
int getx( );
int gety( );
void moverel( int dx, int dy );
void moveto( int x, int y );
void refreshbgi(int left, int top, int right, int bottom);
void refreshallbgi( );
void setbkcolor( int color );
void setcolor( int color );
void setfillpattern( char *upattern, int color );
void setfillstyle( int pattern, int color );
void setlinestyle( int linestyle, unsigned upattern, int thickness );
void setrefreshingbgi(bool value);
void setviewport( int left, int top, int right, int bottom, int clip );
void setwritemode( int mode );
// Window Creation / Graphics Manipulation
void closegraph( int wid=ALL_WINDOWS );
void detectgraph( int *graphdriver, int *graphmode );
void getaspectratio( int *xasp, int *yasp );
char *getdrivername( );
int getgraphmode( );
int getmaxmode( );
char *getmodename( int mode_number );
void getmoderange( int graphdriver, int *lomode, int *himode );
void graphdefaults( );
char *grapherrormsg( int errorcode );
int graphresult( );
void initgraph( int *graphdriver, int *graphmode, char *pathtodriver );
int initwindow
( int width, int height, const char* title="Windows BGI", int left=0, int top=0, bool dbflag=false, bool closeflag=true );
int installuserdriver( char *name, int *fp ); // Not available in WinBGI
int installuserfont( char *name ); // Not available in WinBGI
int registerbgidriver( void *driver ); // Not available in WinBGI
int registerbgifont( void *font ); // Not available in WinBGI
void restorecrtmode( );
void setaspectratio( int xasp, int yasp );
unsigned setgraphbufsize( unsigned bufsize ); // Not available in WinBGI
void setgraphmode( int mode );
void showerrorbox( const char *msg = NULL );
// User Interaction
int getch( );
int kbhit( );
// User-Controlled Window Functions (winbgi.cpp)
int getcurrentwindow( );
void setcurrentwindow( int window );
// Double buffering support (winbgi.cpp)
int getactivepage( );
int getvisualpage( );
void setactivepage( int page );
void setvisualpage( int page );
void swapbuffers( );
// Image Functions (drawing.cpp)
unsigned imagesize( int left, int top, int right, int bottom );
void getimage( int left, int top, int right, int bottom, void *bitmap );
void putimage( int left, int top, void *bitmap, int op );
void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right1=0, int right=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
void readimagefile(
const char* filename=NULL,
int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX
);
void writeimagefile(
const char* filename=NULL,
int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
// Text Functions (text.cpp)
void gettextsettings(struct textsettingstype *texttypeinfo);
void outtext(char *textstring);
void outtextxy(int x, int y, char *textstring);
void settextjustify(int horiz, int vert);
void settextstyle(int font, int direction, int charsize);
void setusercharsize(int multx, int divx, int multy, int divy);
int textheight(char *textstring);
int textwidth(char *textstring);
extern std::ostringstream bgiout;
void outstream(std::ostringstream& out=bgiout);
void outstreamxy(int x, int y, std::ostringstream& out=bgiout);
// Mouse Functions (mouse.cpp)
void clearmouseclick( int kind );
void clearresizeevent( );
void getmouseclick( int kind, int& x, int& y );
bool ismouseclick( int kind );
bool isresizeevent( );
int mousex( );
int mousey( );
void registermousehandler( int kind, void h( int, int ) );
void setmousequeuestatus( int kind, bool status=true );
// Palette Functions
palettetype *getdefaultpalette( );
void getpalette( palettetype *palette );
int getpalettesize( );
void setallpalette( palettetype *palette );
void setpalette( int colornum, int color );
void setrgbpalette( int colornum, int red, int green, int blue );
// Color Macros
#define IS_BGI_COLOR(v) ( ((v) >= 0) && ((v) < 16) )
#define IS_RGB_COLOR(v) ( (v) & 0x03000000 )
#define RED_VALUE(v) int(GetRValue( converttorgb(v) ))
#define GREEN_VALUE(v) int(GetGValue( converttorgb(v) ))
#define BLUE_VALUE(v) int(GetBValue( converttorgb(v) ))
#undef COLOR
int COLOR(int r, int g, int b); // No longer a macro
#ifdef __cplusplus
}
#endif
// ---------------------------------------------------------------------------
#endif // WINBGI_H
dle toho to návodu jsem vložit vše do svého pc, mám win XP.
http://www.cse.dmu.ac.uk/~bb/Teaching/8051board/CodeBlocks.htm
avšak při překladu programu mi píše chybovou hlášku:
d:\codeblocks-ep\codeblocks-ep\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\..\include\graphics.h|302|error: redefinition of 'int right'|
d:\codeblocks-ep\codeblocks-ep\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\..\include\graphics.h|302|error: 'int right' previously declared here|
||=== Build finished: 2 errors, 0 warnings (1 minutes, 3 seconds) ===|
co s tím???
vše jsem sem vkládal dle tohoto návodu ... a stejně mi to přeložit nejde
promin, nekoukal sem - v tu chvíli mě to nenapadlo...
Ale teď jiný problém - sice už to překládá ale i přes to, že v Minigw mam hlavičkové soubory open gl i v include to mam vložené - vše dle návodu dokonce i v system 32 mam dllky ... Přesto mi to píše následující:
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `__glutInitWithExit'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `__glutCreateWindowWithExit'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `__glutCreateMenuWithExit'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glMatrixMode'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glLoadIdentity'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glViewport'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__gluPerspective'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glMatrixMode'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glEnable'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glClearColor'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glEnable'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glEnable'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glClear'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glLoadIdentity'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `_imp__glTranslatef'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutSolidTeapot'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutSwapBuffers'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutInitDisplayMode'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutInitWindowSize'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutInitWindowPosition'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutDisplayFunc'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutIdleFunc'|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to|
D:\GLUT\GLUT_01.o:GLUT_01.cpp|| undefined reference to `glutMainLoop|
||=== Build finished: 24 errors, 0 warnings (0 minutes, 16 seconds) ===|
co teď s tím?
čau, toto mi píše překladač u CodeBlocks když dám build
aaa - Debug": The compiler's setup is invalid so Code::Blocks cannot find/run the compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
co s tím?
#include<gl>
void onResize (int w, int h)
{
glMatrixMode (GL_PORJECTION);
glLoadIdentity ();
glViewport (0,0,w,h);
gluPerspective (45,(double)w / (double)h,1,100);
glMatrixMode(GL_MODELVIEW);
}
void init() {
glEnable(GL_DEPTH_TEST); // povolí se testování hloubky
glClearColor(1.0,1.0,1.0,1.0); // nastaví se barva pozadí
glEnable(GL_LIGHTING);// zapnou se svìtla
glEnable(GL_LIGHT0); // zapne se svìtlo 0
}
void onDisplay(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); // vymaže se frame buffer a depth buffer, aby se do nìj mohlo zaèít znovu kreslit
glLoadIdentity(); // modelview matice se nastaví na jednotkovou
glTranslatef(0.0, 0.0, -4.0); // provede se posun
glutSolidTeapot(1); // vykreslí se konvice (to je jeden ze tvarù, které má GLUT pøednastavené)
glutSwapBuffers(); // prohodí se buffery (jeden se pošle na výstup a do druhého se zaène znovu vykreslovat).
}
int main(int argc, char ** argv)
{
glutInit (&argc,argv);
glutInitDisplayMode (GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSIZE (640,480);
glutInitWindowPosition (10,10);
glutCreateWindow ("Moje první glut okno");
glutDisplayFung (onDisplay);
glutIdeFunc (onDisplay);
glut ReshapeFunc (onResize);
init();
glutMainLoop();
return 0;
}
Chlapy ale tu funkci na zjištění nejvyšší mám vymyslet já :-) to je to oč tu běží. Nemam použít hotovou ale vymyslet svou :-)
a jak konkrétně tento příklad? nějak na to přijít nemohu
Ahoj, Potřebuju aby argumentem funkce bylo pole čísel a ta funkce by měla pomocí cyklu zjistit nejvyšší z těch 5 čísel obsažených v poly které jí předám. Jak na to v c++? Má to ovšem háček, funkce má být šablonová ...
ahoj, kde je chyba? Proč to tu cookies nedělá?
<?php
$a=$_POST ['run'] ;
$data=array("username"=>"***", "domain"=>"seznam.cz" , "password" => "***", "loginType" => "seznam");
$url='https://login.szn.cz/loginProcess';
$verbose=1;
function postit($data,$url,$verbose){
$s="";
foreach($data as $key=>$val)
{
if (!empty($s)) $s.= '&';
$s.= $key.'='.urlencode($val);
}
// init
$ch = curl_init($url);
// set options
curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
curl_setopt($ch, CURLOPT_VERBOSE, $verbose);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$s);
// perform post
$rr=curl_exec($ch);
if ($verbose) echo $rr;
$ckfile = tempnam ("/tmp", "CURLCOOKIE") ;
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
/* STEP 3. visit cookiepage.php */
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close($ch);
}
postit($data, $url, true);
?>