воскресенье, 5 октября 2014 г.

All you need is

Once again a stream of thoughts about this hackneyed worn out topic. 
Being investigating myself mostly during the last time and trying to understand the cause of my inner feelings I came up with two types of love. 
Love is the wrong word. This word has absolutely different meanings for different people. Almost everyone think being in love with a person bidirectionally means that you belong to each other. This is absolutely wrong. Love shouldn't bring any moral, mental, physical constraints into life, only joy. It should be the source of inspiration, nirvana, the corner of relaxation, no hint of coercion or violent forcing to something. It should help you come closer and closer to what you like, to find yourself. 
So, I came with two thoughts. 
The first is like this - imagine the thing you like most in your life, the thing or a process, like reading, watching movies, listening to music, chocolate or beer. Beer. It makes you feel good, happy, or just makes you move into state you enjoy being in. It wants nothing from you. You can relax. You can have it whenever you wish. You can stop having it whenever you wish. The same can be projected on other things - books, food, walks, porn, programming - up to you. Someone may say that I can't call this love. But I can, because that's one of my definitions for that word. This is love, this is apearing exclusively based on my wish. The common characteristic of all these objects is their continuous availability and the lack of opportunity to reject you enjoy it. Beer can't stop you from drinking beer at some moment, your wish stops you. 
The next thought is different. I like to receive presents. But sometimes I really like to make presents to some people to see their smiling eyes, for some unknown reason. That doesn't mean I like making presents to everyone every time.. of course not, because it is also my wish and wishes are volatile and spontaneous. How do I understand that I love the person? Well, it's not one-moment conclusion. I love the person when it's fun to be and to stay with the person. I don't now speak about this classic definition of "love" between a boy and a girl, when they date, kiss, etc. I can love anyone, not looking at the gender. The request is like with the previous beer story, I still have some wish (much more complicated and tangled then the wish of something beer gives),  and I this person is somehow able to fill the emptied by this wish parts of my soul. These parts are replacable, but don't want to be empty though. For that I love some people, few of them, because rare of them are able to do this magic, help me exploring things, understand dark lanes and alleys I am trying to grasp. That is my wish, but there are also wishes of that person, person isn't a beer. One moment comes, when I think that I can put up with some things I don't completely like, because I love the feeling I get being with the person. And this feeling of readiness to accept is like giving a certain amount of yourself to continue satisfy the wishes, not your own wishes this time. Until you are ready to give away something that you love for something you love even more - it makes sense, and this is real love too. Otherwise it wouldn't bring you joy, because you would be trying to hunt and chase for people losing the initial source of what you really like.

понедельник, 4 августа 2014 г.

Tunes of people

Music is wonderful. Songs and melodies make my soul feel undescribable inexpressible feelings, waking up new unknown lights and colors inside. It is hard and always pleasant at the same time to find and hear the melody that can unexpectedly touch delicate shivery parts of my heart at this current moment. But when it is found huge attraction arises so it is twice difficult to stop listening this song. I think it happens because person contains sort of a mix of  wishes, memories, dreams, imagination,emotions, fantasies, moods, thoughts ... and all these ingredients, combination of them can't be expressed and shown clearly, as it is. It is like hash, we can't get the real value from hash easily, so it's hard to know exactly if it would suit us, to know it we need to compare our hash with all others, millions of others. It's like plunging into the ideal invisible reality where true person is woken up and it can last forever. So you are in love and you can do nothing with it ♥
Technologies are also like melodies! And...
People are like melodies. Dealing with a person is like listening to the song. You can enjoy it or not. And the process that identifies the pleasure is the same magic as with music with one additional detail. Melodies are something intangible and ineffable, but people are concrete. But people are tricky, they encapsulate intangible and ineffable mix of magic inside. Like functors or monads. Though, it doesn't matter. There is also an option, when you like the person, but at some moment realize that "there is nothing more interesting" or similar. Comparing to music, it is when you listened to your favorite song 100500 times and then just lost your interest. How many "favorite" songs did you have?
Yes, strange thoughts come to my mind because I am writing this :) There is one common in all of this. Why do we listen to music? communicate with new people? Why do we try new technologies? To have fun. To receive the positive. To revive the things we are missing inside. And then why we become bored of songs, tired on people.. In my thinking, it is kind of human inertia. If we feel awesome now with current way of things we are trying to leave everything as is, expecting everything to stay as is. But the world changes, and we are changing. While listening to music I have fun and I'm happy when I hear new incredible songs, and when I got used to them I just listen to another songs from which I will potentially find another great ones. When I meet new and awesome people IRL or in the Internet it is really interesting and fascinating, everyone is so different, each of them brings certain happiness.
What I wanted to say... Don't be tied and attached to one-moment immediate things, I mean don't get upset when they transform into something else and don't cause the same feelings that  have inspired you earlier. Stay focused on what you expected to get from it.

четверг, 22 августа 2013 г.

Happiness the way I see it

Recently, I have noticed a movie on TV. It is a pity that I didn’t hit at the very beginning and didn’t see the name of it. The movie was a bit boring and monotonous, but it was impossible not to be watching it. The picture was like this: A monk and a young guy are going up the rocks on the hill. All the way monk tells the guy that when they reach their destination to the top of the mountain - they see something quite extraordinary, something supernatural, incredible, but did not say specifically what it should be. The path to the top is very long and complicated to go. They are talking about life on different topics... A monk asks the young man: "Are you happy?" He answers: "Now, we are going such a huge way, and we will open something amazing. Yes, I am happy." Next, at some point, monk stops and says: "Well, we have reached the destination." The guy turns around and asks: "So what? What is incredible?" The look of monk stops at some stone: "Well, let’s take for example this stone. It's perfect." Man with a disappointed face asks the monk: "And we have walked for so long only in order to see some common stone. Are you kidding me?" Monk responded: "But were you happy and did you enjoy the way you overcame?"
This movie made me think over what true happiness is really about and why some people are unhappy. Many philosophers and books assert that happiness is manifested only in special moments and did not stay for long with us. I see happiness as a substance, abstract and even infinite or recursive process. But as with any process, the "happiness" process must have some effect (the task, purpose, destiny if you want). While the young man was going to something unimaginable, to the fact that he wants to see, he was happy throughout even extremely complicated way. I identify the place where he was going - like a dream, and his way to the top - happiness. That is, true happiness is impossible when there is no dream, while the "dream come true" isn’t so important, because you've already worked this way to a dream, and you are happy. Happiness is not a goal in itself, it is a movement to it.
So, to be happy, you need to find a dream to follow the right way and enjoy it.
Why are some people unhappy then? Don’t they have dreams? If you think so, this is partly true. If you look at the life of an ordinary person not from a rich family, who is working every day and hates his job, who stays working at night to feed his children, he gets tired, he has money just enough to pay for the food and the flat, which he has been saving all his life... In this situation, the meaning of a person's life – “Live - to survive”. And unfortunately, it's not uncommon. It’s very difficult in this situation to find the strength to do something, and in general, to find the desire even to want something. And in fact, it is a problem. For every person in the world under all circumstances, no matter how hopeless it may seem, the potential dream of his life surely exists to open the happiness way if he looks carefully.
Some kind of person has many small pleasures in his life, which are forgotten very soon, and all again continues to be boring. Happy person faces some unpleasant things, happening frequently, overcomes it soon and continues enjoying his life again.

четверг, 25 июля 2013 г.

18!

Well, I'm eighteen by now. I have imagined this moment in a different way. In fact, everything turned out to be pretty well. I am glad that I am me and not someone else. So, here are just my thoughts. It has no value for others, but a great matter for me.
Confirmed one amazing thing which I hadn’t believed in earlier. I realized that an ideal does exist and I'm convinced of this. It exists, but it is not achievable (as always :) I am lucky. At least, I can’t do that, though I have a huge desire. Perhaps this is just a bad joke of the energy conservation law. But, if it still subsists, then maybe the fact of its inaccessibility can be fixed somehow. Or not, maybe the perfect is to be so abstract, so that one can only dream of it. But I hope for the opposite :)
Sometimes I make rules for myself, when I repeat the same mistake several times. I am very easy to become attached to people. Perhaps this is part of my kind and naive character (and modest of course :). But the fact is that if a person starts to occupy a large part of your heart, when he disappears from your life, even for a short time, you miss him very very much and feel that something important is missing from you, it hurts. So I'm struggling not to get used to someone, I don’t know whether it's right or not, but when you're attracted to person, it's hard to resist. Anyway, this life is not so interesting, when you don't have someone to be inside your thoughts :)
Some moments I catch myself thinking, e.g. when I want to do something, but I know that I can't. Why can not we? Because. You just can’t. Nobody behaves such a way. What people would think. Bla-Bla-Bla. So - this is complete garbage. There is no the word "you can't". If you need it, or really want it -> it IS allowed (not speaking about violations of the law). And you don't have to be cared of any common principles and even social norms. Every single creature has an opportunity to go its own way. Generally every time there's a word you can not, ask yourself: 'what the hell'. You'll have a different view on the problem after. I actually believe that it’s possible to achieve dreams. You just need a clear plan, and strictly to follow it all the time to go through it, and never to stop going. After all, if there is a destination on the map, then in order to get there you just have to go, and sooner or later you find yourself where you want. I now have the advantage, and it is due to the fact that on my way there was nothing superfluous, and it saved me a lot of precious time that can be spent usefully. Strange, isn’t it? Looking at a sweet lovely girl nobody suspects that she grows wiser and wiser and wiser every day. I get pleasure from the fact that I'm drawn to it and I'm getting smarter. Recently caught myself thinking that sooner or later I'll have to get married, have kids (no, no, not in the sense that I do not want it - on the contrary :), and I have to stop programming, I just won’t have enough time. Sad … But now I can do it as long as I wish, and most importantly - What I wish. It is so encouraging that there is a technology! I believe that it will be even possible to download food soon, just not sure whether it’s possible biologically or chemically to know the composition and the DNA of the substance and to express it with some formula. If you're engaged in an interesting affair, you can head and share a lot of amazing things. Especially when there are no distractions. I want to raise a force of character and try to keep concentration for a long time, not wasted on some small things. Some days I’m checking my e-mail with 5-minute interval, want to get rid of it.
Actually, I have great plans for the future life. To implement the most impressive of my ideas, to run my projects on, to speak at the conferences, to write a book, maybe to teach programming at the University and engage in research, to visit the most interesting beautiful places in the world, to taste the most delicious and unusual dishes, finally, to go to the rock 'n' roll concert, visit Disneyland, to touch the clouds form an air balloon, to catch a salmon from the yacht, learn to play snooker, fall in love forever and many many another things :)

четверг, 30 мая 2013 г.

WCF Quotas

When using WCF and transferring rather big objects or collection of objects or objects with a big amount of inner properties through the network, you can encounter a problem something like here:

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service

The underlying secure session has faulted before the reliable session fully completed. The reliable session was faulted.

Server stack trace:
   at System.Runtime.InputQueue`1.WaitQueueReader.Wait(TimeSpan timeout, T& value)
   at System.Runtime.InputQueue`1.Dequeue(TimeSpan timeout, T& value)
   at System.ServiceModel.Channels.InputQueueChannel`1.Dequeue(TimeSpan timeout, TDisposable& item)
   at System.ServiceModel.Channels.DuplexChannel.TryReceive(TimeSpan timeout, Message& message)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation,
   Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,
   ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
                                                                         …
When starting WCF service locally – the exception disappears and everything works clearly.
Here are quotas on the level of binding:
MaxBufferPoolSize, MaxBufferSize, MaxReceivedMessageSize, MaxArrayLength, MaxBytesPerRead, MaxDepth, MaxNameTableCharCount, MaxStringContentLength.


Another point is that WCF uses dataContractSerializer or xmlSerializer when transferring objects. DataContractSerializer has maxItemsInObjectGraph property limit. It has 65535 value by default.

Here is possible solution for this problem:

1.      In your server configuration file (App.config/Web.config) find your binding and set required properties that override default values and add dataContractSerializer setting in serviceBehavior section:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
<behaviors>
      <serviceBehaviors>
        <behavior name="Common">
          <serviceMetadata httpGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
        <bindings>
               <netTcpBinding>
       <binding name="YourBindingName"
                        maxBufferSize="2147483647"
                        MaxBufferPoolSize ="2147483647"
                        maxReceivedMessageSize="2147483647"
                        openTimeout="00:10:00"
                       receiveTimeout="00:10:00"
                       transactionFlow="true" >
          <reliableSession enabled="true" inactivityTimeout="00:10:00"/>
          <readerQuotas maxStringContentLength="2147483647"
                                      maxArrayLength="2147483647"
                                      maxBytesPerRead="2147483647"
                                      maxDepth="2147483647"
                                      MaxNameTableCharCount="2147483647"/>
          <security mode="Transport">
            <transport clientCredentialType="Windows"/>
          </security>
        </binding>
               </netTcpBinding>
        </bindings>
<services>
      <service behaviorConfiguration="Common" name="YourServiceName">
        <host>
          <baseAddresses>
            <add baseAddress="YourServiceBaseAddress" />
          </baseAddresses>
        </host>
        <endpoint name="YourEndpointName" address="" binding="netTcpBinding"
                           bindingConfiguration="YourBindingConfiguration" contract="YourContract" />
        <endpoint address="net.tcp://targetServer:777/Services/YourServiceName/mex"
                            binding="mexTcpBinding"
                            contract="IMetadataExchange" />
      </service>
</services>
        <client>
            <endpoint address="yourAddress"
                binding="netTcpBinding" bindingConfiguration="bindingName"
                contract="yourContract" name="endpointName">
                <identity>
                    <userPrincipalName value="yourUser@yourDomain.com" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>
2.      On the client size open configuration file and set the required options (client needs endpointBehaviors to be set):
<system.serviceModel>
    <behaviors>
    <endpointBehaviors>
        <behavior name="ClientBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
    </endpointBehaviors>
    </behaviors>
    <bindings>
      <netTcpBinding>
        <binding name="YourBindingName"
          maxBufferSize="2147483647"
          maxReceivedMessageSize="2147483647"
          openTimeout="00:10:00"
          receiveTimeout="00:10:00"
          transactionFlow="true"
          transactionProtocol="OleTransactions">
          <reliableSession enabled="true" inactivityTimeout="00:10:00"/>
          <readerQuotas
                        maxStringContentLength="2147483647"
                        maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647"
                        maxDepth="2147483647"
                        maxNameTableCharCount="2147483646"
                        />
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint
        address="YourServiceName"
        binding="netTcpBinding"
        bindingConfiguration=" YourBindingName "
        contract="YourContract"
        name="endpointName"
        behaviorConfiguration="ClientBehavior">
        <identity>
          <userPrincipalName/>
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>

пятница, 26 апреля 2013 г.

JUNPATTERNS

JUNPATTERN 1.          
   
Use as many JUNPATTERNS as you can in your applications.

JUNPATTERN 2.             

Make everything public. No matter what – fields, properties, methods… If someone has the goal to hack your app – he will manage to do this anyway. So why then we need to suffer from the lack of access to something once again?!

JUNPATTERN 3.             

Make members static, if possible. Especially methods. Why do we need to create an instance of an object to access the method, if we can simply make it static and use it on the class level?! So the best solution is to make it static, believe me.

JUNPATTERN 4.           

Copy the code. So you always have needed logic in front of your eyes, without making mouse clicks in attempt to find some method. We even don’t need these complications with inheritance!

JUNPATTERN 5.           

Don’t write unit tests – they are useless. If you have written the code, you clearly know that it works splendid! Therefore – unit testing is just the waste of your time.

JUNPATTERN 6.        
     
Don’t be afraid of nested code blocks. That’s OK if you face with 10-level nested code construction. Why should we spray our important and complex business logic in different locations?!

JUNPATTERN 7.        
     
Create a special class for storing various methods. So it’s a great and convenient location to place all methods you don’t know where to place. Don’t forget to make it static!

JUNPATTERN 8.            

Always catch exceptions and use empty catch blocks. It prevents users of our application from being scared at the sight of the error message.

JUNPATTERN 9.          
   
Create methods large number of parameters, instead of separating the global task solution into separate methods with few parameters. This approach is more resultative and convenient.

JUNPATTERN 10.         
To be continued…

четверг, 11 апреля 2013 г.

Big Promise


 I give a promise that I will continue to move forward and I will do my best not to accept the compromise. I will not allow anyone to encroach upon my independence. I promise that I won't pay attention to what others think, I'll just go ahead and do what I have conceived, and deem it necessary.