• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

SKA news

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    Originally posted by bogeyman
    Wow! Now I realise I'm dealing with a super-dooper search expert
    I've written code from scratch to index 200 mln web pages and will scale this up to 1 bln pages, is there anything you have done in the past that makes you a better expert in these things?

    select * from products where keyword like '%example%'

    does not count

    Comment


      #92
      Originally posted by AtW
      I've written code from scratch to index 200 mln web pages and will scale this up to 1 bln pages, is there anything you have done in the past that makes you a better expert in these things?

      select * from products where keyword like '%example%'

      does not count
      Oh God give it a rest you sad git.

      I think I'd rather stab cocktail sticks in my eyes that discuss the finer points of software engineering with a tosser like you.

      Your code is utter toss! If I had a junior that wrote code like your switch (below) I would bang his head repeatedly against a door until he bled.

      // Code By Alex Chunderbus...

      switch((byte)cChar)
      {
      case 0:
      goto GetOut;

      //case (byte)'>':
      case 62:

      //bQuotesAllowed=false;
      // if we are in comments mode then we will be waiting for -->
      if(bComments)
      {
      if(LookBack(2)=='-' && LookBack(3)=='-')
      {
      bComments=false;
      return oChunk;
      }
      }
      else
      {
      if(!bQuotes)
      {
      if(oChunk.bComments)
      oChunk.oType=HTMLchunkType.Comment;
      else
      {
      if(oChunk.bClosure)
      oChunk.oType=HTMLchunkType.CloseTag;
      else
      oChunk.oType=HTMLchunkType.OpenTag;
      }
      return oChunk;
      }
      }

      break;

      //case (byte)'"':
      case 34:
      //case (byte)'\'':
      case 39:

      if(bQuotes)
      {
      if(cQuotes==cChar)// && bQuotesAllowed)
      {
      bQuotes=false;
      //bQuotesAllowed=false;
      }
      else
      goto AddSymbol;
      }
      else
      {
      //if(bQuotesAllowed)
      {
      bQuotes=true;
      cQuotes=(byte)cChar;
      }
      }

      break;

      //case (byte)'/':
      case 47:



      You've come right out the other side of the forest of irony and ended up in the desert of wrong.

      Comment


        #93
        Originally posted by bogeyman
        Your code is utter toss!
        Its a high performance HTML parser - I've actually improved it further by doubling speed. Why should I care what you think how well the code looks like? Performance has opposite direction of "nice looking code".

        A few people who got it for free online emailed me their thanks - not one of them said the code did not look well, most likely because they have tried writing their own and came to conclusion that fast parser like this is good enough for their purposes to bitch about code look like.

        The thing is that I have done something fairly sizeable that few people in the world achieve, almost nobody given near zero resources I have. And you've got nothing to show, what a suprise.

        Now go on show me your code.

        Comment


          #94
          Yeah come on Bogeybollocks, he's shown us what he can do, what have you got?
          His heart is in the right place - shame we can't say the same about his brain...

          Comment


            #95
            Here is some of mine - what does it do AtW ?

            Code:
            #ifndef _TFUNCTOR_
            #define _TFUNCTOR_
            
            class TFunctor
            {
            public:
              virtual void operator()(Vec_I_DP &x, Vec_O_DP &f)=0;  
              virtual void Call(Vec_I_DP &x, Vec_O_DP &f)=0;       
            };
            
            
            template <class TClass> class TSpecificFunctor : public TFunctor
            {
            private:
            	void (TClass::*fpt)(Vec_I_DP &x, Vec_O_DP &f);   
            	TClass* pt2Object;                  
            
            public:
            
            	 TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(Vec_I_DP &x, Vec_O_DP &f))
            		{ pt2Object = _pt2Object;  fpt=_fpt; };
            
            	virtual void operator()(Vec_I_DP &x, Vec_O_DP &f)
            	{ (*pt2Object.*fpt)(x,f);};              
            
            	
            	virtual void Call(Vec_I_DP &x, Vec_O_DP &f)
                         { (*pt2Object.*fpt)(x,f);};             
            
            };
            
            #endif;

            Comment


              #96
              Immediately tells me you'd be the first to be fired when I took over the project as you don't comment your code.
              Insanity: repeating the same actions, but expecting different results.
              threadeds website, and here's my blog.

              Comment


                #97
                I took the comments out deliberately - otherwise that would make it a bit too easy for you.

                Comment


                  #98
                  Originally posted by threaded
                  Immediately tells me you'd be the first to be fired when I took over the project as you don't comment your code.
                  I wouldn't need an excuse to fire him. Some pleasures are too divine to forego.

                  Comment


                    #99
                    Originally posted by Jabberwocky
                    Here is some of mine - what does it do AtW ?

                    Code:
                    #ifndef _TFUNCTOR_
                    #define _TFUNCTOR_
                    
                    class TFunctor
                    {
                    public:
                      virtual void operator()(Vec_I_DP &x, Vec_O_DP &f)=0;  
                      virtual void Call(Vec_I_DP &x, Vec_O_DP &f)=0;       
                    };
                    
                    
                    template <class TClass> class TSpecificFunctor : public TFunctor
                    {
                    private:
                    	void (TClass::*fpt)(Vec_I_DP &x, Vec_O_DP &f);   
                    	TClass* pt2Object;                  
                    
                    public:
                    
                    	 TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(Vec_I_DP &x, Vec_O_DP &f))
                    		{ pt2Object = _pt2Object;  fpt=_fpt; };
                    
                    	virtual void operator()(Vec_I_DP &x, Vec_O_DP &f)
                    	{ (*pt2Object.*fpt)(x,f);};              
                    
                    	
                    	virtual void Call(Vec_I_DP &x, Vec_O_DP &f)
                                 { (*pt2Object.*fpt)(x,f);};             
                    
                    };
                    
                    #endif;
                    Jabber, you're a very naughty boy...

                    Your code is almost exactly the same as this :

                    //-----------------------------------------------------------------------------------------
                    // 4.2 How to Implement Functors

                    // abstract base class
                    class TFunctor
                    {
                    public:

                    // two possible functions to call member function. virtual cause derived
                    // classes will use a pointer to an object and a pointer to a member function
                    // to make the function call
                    virtual void operator()(const char* string)=0; // call using operator
                    virtual void Call(const char* string)=0; // call using function
                    };


                    // derived template class
                    template <class TClass> class TSpecificFunctor : public TFunctor
                    {
                    private:
                    void (TClass::*fpt)(const char*); // pointer to member function
                    TClass* pt2Object; // pointer to object

                    public:

                    // constructor - takes pointer to an object and pointer to a member and stores
                    // them in two private variables
                    TSpecificFunctor(TClass* _pt2Object, void(TClass::*_fpt)(const char*))
                    { pt2Object = _pt2Object; fpt=_fpt; };

                    // override operator "()"
                    virtual void operator()(const char* string)
                    { (*pt2Object.*fpt)(string);}; // execute member function

                    // override function "Call"
                    virtual void Call(const char* string)
                    { (*pt2Object.*fpt)(string);}; // execute member function
                    };
                    Taken from this website...

                    http://www.newty.de/fpt/functor.html

                    Oh Dear, Jabber's been caught doing a Threaded...

                    Comment


                      All the best code is modified from others. But you still haven't told me what it does.

                      Comment

                      Working...
                      X