Anonymní profil eXilim – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Anonymní profil eXilim – Programujte.comAnonymní profil eXilim – Programujte.com

 

Příspěvky odeslané z IP adresy 195.113.159.–

PHP › Parsování html stránky
6. 5. 2011   #141634

Cau, potreboval bych získat data z cizí stránky, a nevim jakym stylem parsovat ta data. Predem diky.

Vzor dat na strance:

<div class="eListing">

<h4>Chuck vs. </h4>
<div class="eDetail">
<div class="eColumnA">
<p class="eColumnTitle">Air date: xx/xx/xx</p>
<img class="eThumb" src="/chuck/images/placeholders/152x81.jpg" width="152" height="81" />
<p class="eCaption"> episode description </p>
</div>
<div class="eColumnB">
<p class="eColumnTitle">Video</p>
<div class="videoCategory">
<img src="/chuck/images/placeholders/80x45.jpg" width="80" height="45" />
<p>Highlight
<a href="#">Watch Now</a></p>
</div>
<div class="videoCategory">
<img src="/chuck/images/placeholders/80x45.jpg" width="80" height="45" />
<p>2-Minute Replay
<a href="#">Watch Now</a></p>
</div>
</div>
<div class="eColumnC">
<p class="eColumnTitle">Related Content</p>
<div class="relatedLinks">
<a class="recap" href="">Recap</a>
<a class="episodePhotos" href="">Episode Photos</a>
</div>
</div>
<div class="clear"></div>
</div>
</div>

PHP › Souborová struktura galerie
5. 5. 2011   #141614

Vytvářím internetovou galerii a nevím jak vyřešit ukládání souborů(obrázků) na server. Konkrétně nevím, jestli mám každému uživateli vytvářet svou vlastní složku s obrázky nebo vkládat všechny obrázky do stejné složky. Případně poraďte, jak bych měl soubory pojmenovávat, aby nevznikaly anomálie.
Předem děkuji za odpověď.

JavaScript, AJAX, jQuery › Kontrola zda string obsahuje…
3. 1. 2011   #137432

zatím to vypadá, že to funguje, díky

JavaScript, AJAX, jQuery › Kontrola zda string obsahuje…
3. 1. 2011   #137429

Delam karetni hru, a potreboval bych kontrolovat jiz vytazene karty. Vytazene karty kazdeho hrace ukladam v hidden formu v teto podobe

<input type="hidden" id="player0" name="karty[]" value="11clubs|13heart|11diamond|10heart|9diamond|">

<input type="hidden" id="player1" name="karty[]" value="7clubs|11heart|12clubs|10clubs|9spade|">
.....

V javascriptu generuju nazev karty ktery je v podobe
13spade

Pote to timto zpusobem kotroluju s jiz vytazenymi kartami, ale bohuzel to nefunguje, a karty se daji vytahnout znova
for(var w = 0; w < pocet_hracu; w++)

{
if($("#player" + w.toString()).val().match(karta.toString()+druh.toString()) == "")
{
//karta je cislo, druh je spade,...
znova = true; //vygenerovat znova kartu
break;
}
else
znova = false;
}

uvitam kazdou pomoc

exim
C / C++ › Strig to Char?
25. 6. 2010   #130685

je tam zakomentovany

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

using namespace System::IO::Ports;
using namespace System::Runtime::InteropServices;
using namespace std;
using namespace System::Text;


ale tu hlasku kterpu sem sem dal bylo s nezakomentovanym namespacem

exim
C / C++ › Strig to Char?
25. 6. 2010   #130683

Příloha

exim
C / C++ › Strig to Char?
24. 6. 2010   #130631

pod čím to najdu?

exim
C / C++ › Strig to Char?
24. 6. 2010   #130629

1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(90) : error C3641: 'InterlockedExchangePointer' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe

1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(102) : error C3641: 'ATL::_AtlGetConversionACP' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(535) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(554) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(572) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(577) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlconv.h(530) : error C3641: 'AtlDevModeW2A' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h(65) : error C2440: 'default argument' : cannot convert from 'int (__cdecl *)(int,const char *,int,const char *,const char *,...)' to 'ATL::CTrace::fnCrtDbgReport_t'
1> Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atltrace.h(146) : fatal error C1903: unable to recover from previous error(s); stopping compilation

exim
C / C++ › Strig to Char?
23. 6. 2010   #130602

Bohužel, ani jedno mi nejde

exim
C / C++ › Strig to Char?
23. 6. 2010   #130599

Zdravim, mám VS a v něm aplikaci kde je kalendář, při změně data se udělá událost a vybrané datum se uloží do proměné string.

Dále potřebuju otevřít soubor s názvem xx.xx.xxxx.txt kde xxxx... je hodnota vybraného datumu, ale bohužel on to chce v charu já už nevím jak to převýst... Díky za rady...

	private: System::Void monthCalendar1_DateChanged(System::Object^  sender, System::Windows::Forms::DateRangeEventArgs^  e) {

System::String ^ vyber = this->monthCalendar1->SelectionStart.ToString(L"d");
this->label2->Text = vyber;




fstream file(vyber+".txt");

file.close();



}



Chyba:
1>c:\users\exilim\documents\visual studio 2008\projects\kalendar\kalendar\Form1.h(154) : error C2664: 'std::basic_fstream<_Elem,_Traits>::basic_fstream(const char *,std::ios_base::openmode,int)' : cannot convert parameter 1 from 'System::String ^' to 'const char *'

1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> No user-defined-conversion operator available, or
1> Cannot convert a managed type to an unmanaged type



Díky

esmen
C / C++ › C++ a odesílání na sériový p…
9. 6. 2010   #129945

Zdravím, stavím malého robota, který komunikuje s počítačem přes wifi.
V počítači vytvořím virtuální COM port (o to se už stará externí sw), v c++ se na něj dokážu připojit, ale nikde nemůžu najít jak mu poslat určitý číslo v binárce? Potřebuju mu posílat třeba 00010011, 10001001, .... prostě různý čísla v binárce... Neexistuje na to už hotová fce? Díky

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128317

http://www.builder.cz/art/cpp/sortalg.html půjde to přes todle? :o)

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128315

Mohu tě ještě využít? když už mám poel v intu, jdou nějak seřadit uložený hodnoty od největšího po nejmenší? (Prvních 10)

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128312

uz to vidim mam tam stringy misti int :o)

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128311

bool vysledky()
{
fstream radek;
fstream radek2;
string line;
int i=0;
int j=0;
string gf;
string hh;

radek.open("db.dat", ios::in);
while (!radek.eof())
{
getline (radek,line);
i++;
}
radek.close();

string * pole = new string[i];

radek2.open("db.dat", ios::in);
while (!radek2.eof())
{
getline (radek2,line);
hh = vycuc(line); // zde mame vycucnuti

pole[j] = hh;
j++;
}
radek2.close();

cout << "Vysledek:" << pole[6] << endl; //jen test jetli to ukazuje to, co má



delete [] pole;
return true;
}

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128309

int GetIntVal (const string &str) {
stringstream ss(str);
int n;
ss >> n;
return n;
}

int vycuc(string name)
{
string d;
int p=0;
for(int x=0; x < name.length();x++)
{
if(name[x] == '§')
{
p = 1;
x += 1;
}
if(p==1) {
d += name[x];
}
}
int num;
num = GetIntVal(d);
return num;
}

num vrací smajlíka o.O

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128308

#include "stdafx.h"
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <sstream>
#include <cstdlib>

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128305

Už to válí díky... ještě se zeptám... Potřebuju převést číslo ze stringu na int, našel jsem todle:

int GetIntVal(string strConvert) {
int intReturn;
intReturn = atoi(strConvert.c_str());
return(intReturn);
}

ale mě to vrací úplný kraviny (čísla vůbec)

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128303

To KIIV : nechapu

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128301

Udelal sem fci:
string vycuc(string name)
{
string d;
int p=0;
for(int x=0; x < name.length();x++)
{
if(name[x] == '§')
{
p = 1;
x += 2;
}
if(p==1) {
d += name[x];
}
}
cout << "Body:" << d;
return d;
}
a pak
string hh;
hh = pole[0].c_str();
cout << hh << endl;

hh = vycuc(hh);
cout << hh << endl;

Vše funguje ale ta funkce vycuc mi nevrací to číslo ale když udelam tohle:



string vycuc(string name)
{
name = "nick§22"; // přeuložim to ručně
string d;
int p=0;
for(int x=0; x < name.length();x++)


tak mi to normálně vrátí 22 jak má...

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128299

Díky moc už mi to jede :)

Ještě se zeptám když mám

string name = "neco..2";

jak mám vytáhnout jen to, co je za těma dvouma tečkama? (V tomto příapdě 2)

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128296

Nejak nechapu, ted jsme zkusil toto:

radek.open("db.dat", ios::in);
while (!radek.eof())
{
getline (radek,line);
i++;
}

string pole[i];

while (!radek.eof())
{
getline (radek,line);
pole[i] = line;
i++;
}


cout << pole[0].c_str() << endl;
cout << pole[1].c_str() << endl;
cout << pole[2].c_str() << endl;
cout << pole[3].c_str() << endl;
cout << pole[4].c_str() << endl;




radek.close();

//Nejdřív zjistim počet řádků a vytvořím pole, ale mě to píše chybu :o(

eXilim
C / C++ › Šibenice -&gt; Výpis výsledk…
4. 5. 2010   #128294

string pole[];

radek.open("db.dat", ios::in);
while (!radek.eof())
{
getline (radek,line);
pole[i] = line;
i++;
}

cout << pole[2];
radek.close();



Proč mi tohle nefunguje?? :o(

 

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý