n3paste.de

::

a haskell happstack pastebin

  • New paste
  • View pastes

  • Login

  • About
  • Most recent pastes (filtered)

    Filter pastes (help):

    16:09 - Mon 2012.05.14

    C++

    Paste: /hesa/Show related

    main-Datei

    #include <iostream>
    #include "CCounter.h"
    #include "CForwardCounter.h"
    #include "CVariableCounter.h"
    using namespace std;
    
    template <class type>
    	type derGroessere( const type &a,const type &b)
    	{
    		return a > b ? a : b;}
    
    
    int main()
    {
    	CForwardCounter gesamtzaehler;
    	CCounter *zaehler1 = new CForwardCounter;
    	CCounter *zaehler2 = new CVariableCounter(-2); //Upcast
    	zaehler1->setValue(0); //Anfangswerte eintragen
    	zaehler2->setValue(50); //Anfangswerte eintragen
    
    

    17:25 - Wed 2012.05.09

    C++

    Paste: /3PK/Show related

    Reply to /X3y/

    template <class type>
    type& derGroessere( type& a, type& b)
    {
    	return a > b ? a : b
    }
    
    //const an geeigneten stellen einfügen
    

    15:42 - Sun 2012.05.06

    C++

    Paste: /eYTR/Show related

    No description.

    void CSwapper::swap_byReference(int& value1, int& value2){
    	int tmp = value1;
    	value1 = value2;
    	value2 = tmp;
    }
    
    void CSwapper::swap_byPointer(int* value1, int* value2){
    	int* tmp = value1;
    	value1 = value2;
    	value2 = tmp;
    }
    

    15:52 - Mon 2012.04.30

    C++

    Paste: /39D/Show related

    No description.

    #include "CCounter.h"
    
    
    CCounter::CCounter()
    {
    	m_value=0;
    }
    
    
    CCounter::~CCounter(void)
    {
    
    }
    
    void CCounter::count()
    {
    }
    
    int CCounter::getValue() const
    {
    

    15:52 - Mon 2012.04.30

    C++

    Paste: /3gH/Show related

    No description.

    #ifndef CCOUNTER_H_
    #define CCOUNTER_H_
    
    class CCounter
    {
    public:
    	CCounter(void);
    	~CCounter(void);
    	virtual void count(void) ;
    	int getValue(void) const;
    	void setValue(int);
    	void resetValue(void);
    	bool operator<(const CCounter&);
    	bool operator>(const CCounter&);
    
    private:
    	int m_value;
    };
    
    #endif
    

    17:54 - Tue 2012.04.24

    C++

    Paste: /QY/Show related

    No description.

    class CCounter
    {
    public:
    	CCounter(void);
    	~CCounter(void);
    	void count(void);
    	int getValue(void);
    	void setValue(int);
    	void resetValue(void);
    
    private:
    	int m_value;
    };
    
    
    1>c:\users\arock\dropbox\max_den\programmieren\c++bungen\2\blatt 2\ccounter.h(2): error C2011: 'CCounter': 'class' Typneudefinition
    1>          c:\users\arock\dropbox\max_den\programmieren\c++bungen\2\blatt 2\ccounter.h(2): Siehe Deklaration von 'CCounter'
    

    18:16 - Thu 2012.03.29

    C++

    Paste: /TjO/Show related

    No description.

    // the pain one must endure to force all arguments to be the same ...
    template<class... Args>
    auto writev(const Args&... args)
    	-> typename std::pair<
    		decltype(
    			std::declval<std::tuple<typename std::pair<Packet&, Args>::first_type...>>()
    				= std::make_tuple(args...)),
    		size_t>::second_type
    

    00:36 - Sun 2012.02.19

    C++

    Paste: /Vj1I/Show related

    Reply to /hMjo/

    #include <algorithm>
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    class graph {
    public:
      graph(int count)
        : _paths(0)
        , _accessibility(count)
      {
        for (int i = 0; i < count; i++) {
          _accessibility.push_back(vector<bool>(count));
          _accessibility[i].resize(count);
          fill(_accessibility[i].begin(), _accessibility[i].end(), false);
        }
    
        _used.resize(count);
        fill(_used.begin(), _used.end(), false);
    

    23:54 - Sat 2012.02.18

    C++

    Paste: /hMjo/Show related

    No description.

    #include <algorithm>
    #include <iostream>
    #include <vector>
    
    using namespace std;
    
    class graph {
    public:
      graph(int count)
        : _paths(0)
        , _accessibility(count)
      {
        for (int i = 0; i < count; i++) {
          _accessibility.push_back(vector<bool>(count));
          _accessibility[i].resize(count);
          fill(_accessibility[i].begin(), _accessibility[i].end(), false);
        }
    
        _used.resize(count);
        fill(_used.begin(), _used.end(), false);
    

    14:29 - Mon 2012.01.23

    C++

    Paste: /hUm/Show related

    Reply to /t7y/

            public int GetDiskFreeSpace(ref ulong freeBytesAvailable, ref ulong totalBytes, ref ulong totalFreeBytes, DokanFileInfo info)
            {
                DebugCall("GetDiskFreeSpace");
                try
                {
                    // Get current db usage
                    Int64 used = (Int64)PostgreSQL.Command("SELECT pg_database_size(current_database())")
                                                  .ExecuteScalar();
                    Debug("GetDiskFreeSpace - Used space: {0}", used);
    
                    // Get free disk space on the server
                    // This requires the postdok_free_disk_space function on the server!
                    //Int64 free = (Int64)PostgreSQL.Command("SELECT postdok_free_disk_space()")
                    //                              .ExecuteScalar();
    
                    Int64 free = 1024 * 1024;
    
                    freeBytesAvailable = (ulong)free;
                    totalFreeBytes = (ulong)free;
                    totalBytes = (ulong)(used + free);
    

    23:27 - Sun 2012.01.22

    C++

    Paste: /XiKm/Show related

    Reply to /Oe/

            public int FindFiles(
                String filename,
                ArrayList files,
                DokanFileInfo info)
            {
                Debug("FindFiles {0}", filename);
    
                try
                {
                    string path = GetPath(filename);
                    ArrayList entries = (ArrayList)GetChannel().ls(path);
    
                    foreach (ChannelSftp.LsEntry entry in entries)
                    {
    
                        FileInformation fi = new FileInformation();
    
                        fi.Attributes = entry.getAttrs().isDir() ?
                            FileAttributes.Directory :
                            FileAttributes.Normal;
    

    23:27 - Sun 2012.01.22

    C++

    Paste: /Oe/Show related

    No description.

            public int FindFiles(string filename, ArrayList files, DokanFileInfo info)
            {
                DebugCall("FindFiles on \"{0}\"", filename);
                try
                {
                    //NpgsqlDataReader rdr = PostgreSQL.Command("SELECT * FROM files WHERE dir = :dir")
                    //                                 .AddParam("dir", NpgsqlDbType.Varchar, filename)
                    //                                 .ExecuteReader();
    
                    FileInformation fi = new FileInformation();
                    fi.FileName = "moep.txt";
                    files.Add(fi);
                    return 0;
                }
                catch (NpgsqlException e)
                {
                    DebugError("FindFiles", e.BaseMessage);
                    return -DokanNet.ERROR_PATH_NOT_FOUND;
                }
            }