Posts

c# unit tests using sockets -

I am trying to write a unit test for a server application which requires sockets in C # . To process the request, I need to read from the socket. I can avoid sockets in Java using currents, so when writing a unit test, I can easily convert a string into a stream. // ====== input ====== InputStream socket InputStream = new input stream (socket.getInputStream ()); // InputStream socket input instead of such a string = new bytereinputstream ("string" .getBytes ()); BufferedReader = new BufferedReader (new InputStreamReader (socketInputStream)); // ====== Output ====== OutputStream socketOptputTream = New outputstream (socket. Getoutputstream ()); // I need to write stream BufferedOutputStream Out = new BufferedOutputStream (socketOutputStream) byte []; I just found NetworkStream () but it also requires a socket. How can I get it in C # so that I can make the stream without sockets? And how can I write a stream and read it again to see if the message is correct? ...

array python to php -

I have to translate a Python code to phyp, but I do not know how this Python code works in php I do not know what the colon is between: "[] between: dec = data_ar [4: len (data_ar)] Thanks This is just so, so I think what you want: Array_slice ($ data_ar, 4);

html - Trying to get CSS shadow on right and left sides -

I have a DIV element which I would like to apply a CSS box shadow also, the problem is, I left it only to the left of the element And I want right. I tried to play with box-shadow: 0 10px # 000; But no matter what I do, he refuses to work. I want shadow to paint 10px and # 000. Thanks You must apply it to your CSS. div {box-shadow: 4px 0 2px # 222, -4px 0 2px # 222; } Here's an example

intuit partner platform - realmId doesn't come from QBO through the OpenId workflow -

We are trying to implement OpenID in our application so that we can connect to QBO. As an example, we use code provided by Intuit The problem is that realmId is zero, basically it is back from the intuit login page on our app Does not come. All other data is correct, such as name, email. We define the attribute fetch.Attributes.Add (new feature (request "http://axschema.org/intuit/ RealmId", true, 1 )); I have read that it was in the bug in Intuit regarding setting some cookies. Is this a problem or am I doing something wrong? I can post more codes if I need to, but this is too much as provided by Intuit. When the customer authorizes access to their data through 3-foot oath flows , Then the realmid call back URL will be on the query string that you provide. There is always a client of OpenID workflow who selects a QuickBooks company. After the OpenID flow, call the Javascript function Direct Connect (), you will get a real ID, Oauth flow as mention...

java - I/O Not Working (Copy File, Paste It) -

I'm trying to get this piece of code to work. This is a basic I / O system that copies a file and pastes it in the same directory with the chosen name. It should be simple, but for some reason the program runs, it creates another file, but then it gets trapped. The CPU sits at about 5% for the Java process and the file is never full. It only copies some figures and then I think it has got stuck in an infinite loop somewhere. I have already compared my code with the byte stream tutorial. Extra: I just read it what he was reading and reading this value 255 is stuck on the infinite loop. If it helps, besides, I compile the code directly from the Oracle website and it does the same thing. I can tell it what it is. Can anyone tell me what I am doing wrong? Thank you (PS: I am using Eclipse 4.2.0.). This is the file I am copying: package fileio; Import java.io * *; Import system Debug; Public class file usage {public static zero copyFileTo (string file2Copy, string fil...

Sencha Touch make Dataview dynamic elements draggable -

I have a data view that is populated using a store and a template so that the process is dynamic. Then I want to make each container division (see template) dragable and want to use the following code. I just consider the container divs (image + name) to be draggable, but instead the whole data view is draggable. Wondering what I am doing? Ext.define ('MyApp.view.allImages', expand: 'Ext.dataview.DataView', xtype: 'cams', required: ['MyApp.store.images' ], Config: {title: 'test', store: 'images', baseCls:' camera-list ', itemTpl: [' id id = "camimage"> "," div class = "Image" style = "background-image: url ({fullimage})"> gt; & gt; / div & gt; ',' & lt; div class = "name" & gt; {address} & lt; / Doc: 'Topbar', Title: 'Gainsville'}, {xtype: 'toolbar', ' This is a problem with the lifetime of the component...

C++: vector implementation and dynamic memory allocation -

I was trying to understand how vector is implemented in C ++ It was asked, and so I looked at it, and I have a small question that it is right to believe the implementation in the connected question, we see this code: int main () {Vector & lt; Int & gt; Test2 = test_Vector (); Cout & lt; & Lt; Test 2 [0] & lt; & Lt; Endl; Return 0; } // Below is not a STL vector object, but one of the related questions, // where the STL vector asking which attempts to apply itself / vector & lt; Int & gt; Test_Vector () {Vector & lt; Int & gt; testing; Test.push_back (5); Return examination; } As I understand, test object is created locally, so when test_vector The method returns, the local object exits from the scope, causing the destructor to be called and delete - dials the dynamic array. Since the code actually works and 5 prints, I think I am wrong, what is the correct explanation? You are right, but you are missing an important poin...