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

Anonymní profil Anonymní uživatel – Programujte.comAnonymní profil Anonymní uživatel – Programujte.com

 

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

Anonymní uživatel
C / C++ › format adresy
30. 5. 2011   #142662

To nervak :
dik moc :) ...

kuk
C / C++ › format adresy
29. 5. 2011   #142654

Ahoj,
pardon, ze to sem davam, ale ja opravdu nevim , kde jinde se zeptat.
Nevite nahodou nekdo jak zapsat adresu, kdyz chci z Anglie neco poslat do CR ?
rekneme ze bydlim v Pelhrimove, ulice Stodulka 22, smer. cislo Pelhrimova je treba 76001
Nemohl by tady nekdo prosim moc napsat, jak by ta adresa mela vypadat ?

Anonymní uživatel
C / C++ › trida v tride... nefunguje
23. 5. 2011   #142431

jooo ..to vim :) ... ja jsem jenom chtel zkusit, jeden figl pres strukturu v tride, ale pak jsem pomoci g++ prisel na to, ze muzu pristupovat jenom k statickym clenskym datum (je to tak ?)

Anonymní uživatel
C / C++ › trida v tride... nefunguje
23. 5. 2011   #142425

To KIIV :
nee ... ? ani nevim jak to myslis. Nemohl by jsi prosim napsat v kodu jak to myslis ?

Anonymní uživatel
C / C++ › trida v tride... nefunguje
23. 5. 2011   #142420

To Anonymní uživatel :
radek 306

Anonymní uživatel
C / C++ › trida v tride... nefunguje
23. 5. 2011   #142419



#ifndef ARRAY_SORTED_ARRAY
#define ARRAY_SORTED_ARRAY

#include <iostream>
#include <algorithm>
#include "Error/Error.hpp"
#include "EArrayClass.hpp"
#include "EArray.hpp"
using namespace std;




namespace SortedArray_Exception
{
// class
};








enum OPEN_OR_CLOSE { OPEN = 13, CLOSE = 14 };
enum INDEX_LF { LEFT = 0, RIGHT = 1 };



template <typename T, typename K = int> // K e -0+
class SortedArray : public Error<SORTED_ARRAY>
{
public:
~SortedArray();
SortedArray(const SortedArray<T>& copy);
SortedArray();

void AddValue(const T& value);
void AddInterval(const T start, OPEN_OR_CLOSE op_1, const T end, OPEN_OR_CLOSE op_2);
void AddValues(const T* const values, K number);
void AddIntervals(const T* const intervals, OPEN_OR_CLOSE* op, K number);
K FindInterval(const T& value) const;
void FindInterval(const T& value, T* interval) const;
void FindInterval(const T& value, OPEN_OR_CLOSE* interval) const;

const EArray<T>* GetDataFromInterval(const K) const;
const OPEN_OR_CLOSE* GetOpenOrClose() const { return OpenOrClose; }
const T* GetInterval() const { return Interval; }
K GetNumberOfInterval() const { return NumberOfInterval; }

SortedArray<T,K>& operator=(const SortedArray<T,K>& right);
SortedArray<T,K> operator+(const SortedArray<T,K>& right);

class DataPointer
{
public:
~DataPointer() {}
DataPointer();
EArray<T>& operator*();
DataPointer operator++();
DataPointer operator++(int);
void operator()(K number_of_interval);

private:
EArray<T>* Pointer;
K AIndex;
};

protected:
OPEN_OR_CLOSE* OpenOrClose;
T* Interval;
K NumberOfInterval;


private:
EArrayClass<EArray<T> >* Data;

const EArrayClass<EArray<T> >* GetData() const { return Data; }

static const K DEFAULT_ERROR_NUMBER = (0);
};



template <typename T, typename K>
SortedArray<T,K>::~SortedArray()
{
delete Data;
delete[] OpenOrClose;
delete[] Interval;
}




template <typename T, typename K>
SortedArray<T,K>::SortedArray(const SortedArray<T>& copy):
NumberOfInterval(copy.GetNumberOfInterval())
{
OpenOrClose = new OPEN_OR_CLOSE[2*NumberOfInterval];
Interval = new T[2*NumberOfInterval];
Data = new EArrayClass<EArray<T> >(1);

(*Data) = (*copy.GetData());

const OPEN_OR_CLOSE* help_open = copy.GetOpenOrClose();
const T* help_interval = copy.GetInterval();

std::copy(help_open, &(help_open[2*NumberOfInterval - 1]), OpenOrClose);
std::copy(help_interval, &(help_interval[2*NumberOfInterval - 1]), Interval);
}




template <typename T, typename K>
SortedArray<T,K>::SortedArray():
NumberOfInterval(0)
{
OpenOrClose = new OPEN_OR_CLOSE[2*NumberOfInterval];
Interval = new T[2*NumberOfInterval];
Data = new EArrayClass<EArray<T> >(0);

/* (*Data) = (*copy.GetData());

const OPEN_OR_CLOSE* help_open = copy.GetOpenOrClose();
const T* help_interval = copy.GetInterval();*/
}



//******************************************************************************************************************
//********************************************Functions declaration*************************************************
//******************************************************************************************************************

//******************************************** public functions ****************************************************


template <typename T, typename K>
void SortedArray<T,K>::AddValue(const T& value)
{
K number_of_interval;
number_of_interval = FindInterval(value);
if(Error<SORTED_ARRAY>::ERROR() == true)
{
return;
}

((*Data)[number_of_interval - 1]).AddEnd(value);
}




template <typename T, typename K>
void SortedArray<T,K>::AddInterval(const T start, OPEN_OR_CLOSE op_1, const T end, OPEN_OR_CLOSE op_2)
{

T* help_interval = new T[2*NumberOfInterval + 2];
OPEN_OR_CLOSE* help_open = new OPEN_OR_CLOSE[2*NumberOfInterval + 2];

if(NumberOfInterval != 0)
{
K i;
for(i = 0; i < NumberOfInterval; i++)
{
help_interval[2*i + LEFT] = Interval[2*i + LEFT];
help_interval[2*i + RIGHT] = Interval[2*i + RIGHT];
help_open[2*i + LEFT] = OpenOrClose[2*i + LEFT];
help_open[2*i + RIGHT] = OpenOrClose[2*i + RIGHT];
}
}

help_interval[2*NumberOfInterval + LEFT] = start;
help_interval[2*NumberOfInterval + RIGHT] = end;
help_open[2*NumberOfInterval + LEFT] = op_1;
help_open[2*NumberOfInterval + RIGHT] = op_2;

delete[] Interval;
delete[] OpenOrClose;
Interval = help_interval;
OpenOrClose = help_open;
NumberOfInterval += 1;

EArray<T> help_array;
Data->AddEnd(help_array);
return;
}




template<typename T, typename K>
void SortedArray<T,K>::AddValues(const T* const values, K number)
{
K i;
for(i = 0; i < number; i++)
{
AddValue(values[i]);
}
}




template <typename T, typename K>
void SortedArray<T,K>::AddIntervals(const T* const intervals, OPEN_OR_CLOSE* op, K number)
{
K i;
for(i = 0; i < number; i++)
{
AddInterval(intervals[2*i + LEFT], op[2*i + LEFT], intervals[2*i + RIGHT], op[2*i + RIGHT]);
}
}




template <typename T, typename K>
K SortedArray<T,K>::FindInterval(const T& value) const
{
K i;
for(i = 0; i < NumberOfInterval; i++)
{
if((Interval[2*i + LEFT] < value && Interval[2*i + RIGHT] > value) || (Interval[2*i + RIGHT] > value && Interval[2*i + LEFT] < value))
{
return i+1;

} else if( (Interval[2*i + LEFT] == value && OpenOrClose[2*i + LEFT] == CLOSE) || (Interval[2*i+RIGHT] == value && OpenOrClose[2*i + RIGHT] == CLOSE))
{
return i+1;

}
}

SetError();
SetErrorValue(ANY_INTERVAL_FOUND);
return (DEFAULT_ERROR_NUMBER);
}




template <typename T, typename K>
void SortedArray<T,K>::FindInterval(const T& value, T* interval) const
{
K help_number_interval = FindInterval(value);
if(Error<SORTED_ARRAY>::ERROR() == true)
{
return;
}

interval[LEFT] = Interval[help_number_interval + LEFT];
interval[RIGHT] = Interval[help_number_interval + RIGHT];
}



template <typename T, typename K>
void SortedArray<T,K>::FindInterval(const T& value, OPEN_OR_CLOSE* interval) const
{
K help_number_interval = FindInterval(value);
if(Error<SORTED_ARRAY>::ERROR() == true)
{
return;
}

interval[LEFT] = Interval[help_number_interval + LEFT];
interval[RIGHT] = Interval[help_number_interval + RIGHT];
}



template <typename T, typename K>
const EArray<T>* SortedArray<T,K>::GetDataFromInterval(const K interval) const
{
return &((*Data)[interval - 1]);
}


//***************************************************************************************************
//**************************************************** DataInterval ********************************
//***************************************************************************************************

template <typename T, typename K>
SortedArray<T,K>::DataPointer::DataPointer():
AIndex(0)
{
Pointer = &((*Data)[0]);
}




template <typename T, typename K>
EArray<T>& SortedArray<T,K>::DataPointer::operator*()
{
return *Pointer;
}



template <typename T, typename K>
SortedArray<T,K>::DataPointer SortedArray<T,K>::DataPointer::operator++(int)
{
//
}



int main()
{
SortedArray<float> help;
float h[2];

help.AddInterval(10, CLOSE, 20, OPEN);
help.AddInterval(21, CLOSE, 30, CLOSE);
help.AddInterval(31, CLOSE, 40, OPEN);
help.AddValue(25);
help.FindInterval(12, h);
cout << h[0] << endl;
cout << h[1] << endl;
if(help.ERROR() == true)
{
cout << "ERROR" <<endl;
}
}

#endif

na radku 305 mi to zahlasi "SortedArray.cpp:305: error: expected constructor, destructor, or type conversion before ‘SortedArray’"
co delam spatne ?

kukuc
OS - GNU / Linux › problem s instalaci
30. 4. 2011   #141418

Ahoj,
asi dva mesice jsem na svuj PC (debian 6.0.x) nic neinstaloval. Dneska jsem chtel nainstalovat samba server a nazdilet slozkz po siti pro snadnejsi komunikaci, ale aptitude mi pri instalaci jakehokoliv programu pise:
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up samba (2:3.5.6~dfsg-3squeeze2) ...
insserv: warning: script 'K07smfpd' missing LSB tags and overrides
insserv: warning: script 'smfpd' missing LSB tags and overrides
insserv: There is a loop at service smfpd if started
insserv: There is a loop between service rmnologin and mountnfs if started
insserv: loop involving service mountnfs at depth 7
insserv: loop involving service nfs-common at depth 6
insserv: There is a loop between service rmnologin and checkroot if started
insserv: loop involving service checkroot at depth 4
insserv: loop involving service hdparm at depth 3
insserv: loop involving service mountnfs-bootclean at depth 9
insserv: loop involving service hwclock at depth 6
insserv: loop involving service hostname at depth 4
insserv: loop involving service fuse at depth 11
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting smfpd depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: loop involving service saned at depth 11
insserv: There is a loop between service rmnologin and mountoverflowtmp if started
insserv: loop involving service mountoverflowtmp at depth 9
insserv: loop involving service mountall-bootclean at depth 8
insserv: There is a loop between service rmnologin and checkfs if started
insserv: loop involving service checkfs at depth 6
insserv: loop involving service ifupdown-clean at depth 6
insserv: loop involving service mountall at depth 8
insserv: loop involving service mtab at depth 6
insserv: loop involving service kbd at depth 14
insserv: loop involving service avahi at depth 14
insserv: loop involving service rsyslog at depth 14
insserv: There is a loop at service rmnologin if started
insserv: loop involving service networking at depth 11
insserv: There is a loop between service smfpd and ifupdown-clean if started
insserv: There is a loop between service rmnologin and mountdevsubfs if started
insserv: loop involving service mountdevsubfs at depth 3
insserv: loop involving service udev at depth 2
insserv: loop involving service smfpd at depth 1
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing samba (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
samba


co stim sankra je ? (hledal jsem na netu ale nasel jenom stranky portugalsky , nebo jakzm to bzlo jazykem...)

prd
OS - GNU / Linux › problem s bootovaci klicenout
16. 2. 2011   #138960

tak oprava,
ja jsem zapomel, ye ta flashka ma vadne sektory, takze se to musi dat na 2. a v 1. ukazat na 2. sektor. A na to jsem zapomel. Kdybyste nepapsal to stim mkdosfs, asi bych si na to nevzpomel....takze dik moc :D:D:D

prd
OS - GNU / Linux › problem s bootovaci klicenout
16. 2. 2011   #138958

To nervak :
mkdosfs jsem pouzil, stejne jako syslinux ..akorat jsem to tam zapomel napsat :(

prd
OS - GNU / Linux › problem s bootovaci klicenout
16. 2. 2011   #138941

Ahoj,
mam problem s bootovaci klicenkou. napise zde presny postup, jak jsem ji vytvarel, jelikoz ja opravdu nevim, kde jsem udelal chybu
( postupoval jsem podle http://www.debian.org/releases/stable/amd64/ch04s03.html.en#usb-copy-flexible)
Takze,
strcil jsem 1 GB flash kingston do USB portu umisteneho primo na MB. Nemountoval jsem. zavolal jako SU "cfdisk -z sdb1" (byl jsem v adresari /dev) nastavil nouvou partition (FAT16, bootable) a ulozil. Klicenku vytahl z pc a zase zastrcil. Nemountoval jsem. zavolal jsem "fdisk sdb1" napsal "p" a zmack enter. Vsechno bylo v poradku, cela falsh naformatovana na FAT16,a u boot byla hvezdicka. mountnul jsem a nakopiroval vimlinuz a initrd.gz (stahl jsem to http://ftp.cz.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/hd-media/). zavolam (prejdu do addr. kde ja flash mountla) "vim syslinux.cfg" a zadam "default vmlinuz append initrd=initrd.gz"
Nahraji cely obraz bez rozbalovani na disk (debian-6.0.0-amd64-kde-CD-1.iso). unmountnu a strcim flashku do notebooku. dam "boot from USB-HDD" a napise mi to "invalid or damaged Bootale partition"


Co sakris delam blbe ??

prd
OS - GNU / Linux › vim - makro ...
15. 2. 2011   #138919

To KIIV :
dik

prd
OS - GNU / Linux › vim - makro ...
15. 2. 2011   #138914

DObry den,
jde nejak v VIMu udelat makro, ktere by mi treba mezi radky 45-69 dalo na zavatek kazdeho radku treba 4 mezery ? Priznam se, ze makra v VIMu delat neumim, pokud by byl nekdo tak hodny a hodil mi sem treba jenom nejakou stranku, kde by to byloi pekne vysvetlene, klidne i v anglictine. Predem diky za pomoc .

co ja vim
OS - GNU / Linux › vetracek u procesoru
14. 2. 2011   #138866

Nazdaarek,
pouzivam debian a zacalo me stvat, ze mi vetracek u procesoru neustale bezi na plno. Nevite nahodou nekdo, jak bych ho mohl ztlumit, nebo aspon zapnout rizeni otacek v zavislosti na aktul. vykoni ??<?

marekoslavik
C / C++ › &quot;spec. pristup&quot;
12. 2. 2011   #138771

no, to me nenapadlo ...

marekoslavik
C / C++ › &quot;spec. pristup&quot;
12. 2. 2011   #138749



class pokus
{
public:
pokus() {}

void zkopiruj(pokus* copy) { copy->Display(); }

private:
void Display() { cout << "do prcic" << endl; }
};

jde v C++ nejak udelat toto. Proste Aby Display byl private ale pritom ho mohla "domovska" trida pouzivat v svych metodach pres sve vytvorene instance ..

janek
Hardware › DVB-T
4. 2. 2011   #138508

Ahoj,
když mám v počítači kartu, která opdporuje DVB-T ,tak bych měl naladit digitální televizi bez jakehokolik dalsiho pristroje ? (mam novou antenu, takovou tu malou, co vypada jako radar ).
Diky za rady.

 

 

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