Search Results

Search found 9 results on 1 pages for 'petar minchev'.

Page 1/1 | 1 

  • Keyboard event issue

    - by Petar Minchev
    Hello guys! I have to capture the following keyboard event in a TextBox - SHIFT + 8(on the numpad). This also means the NumLock will be on. When I try the following, nothing is printed: private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Shift && e.KeyCode == Keys.NumPad8) Console.WriteLine("SHIFT + UP"); } But CTRL + 8(on the numpad) is working. private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.NumPad8) Console.WriteLine("CTRL + UP"); } Could someone explain me, why SHIFT + 8 isn't fired, but CTRL + 8 is working? P.S. I wrote + UP, because the user wants to navigate with the numpad arrows and the SHIFT key, but his NumLock will also be on. That's why I catch Keys.NumPad8. All the best, Petar

    Read the article

  • Mono doesn't write settings defaults

    - by Petar Minchev
    Hi guys! Here is my problem. If I use only one Windows Forms project and call only - Settings.Default.Save() when running it, Mono creates a user.config file with the default value for each setting. It is fine, so far so good. But now I add a class library project, which is referenced from the Windows Forms project and I move the settings from the Windows Forms project to the Class Library one. Now I do the same - Settings.Default.Save() and to my great surprise, Mono creates a user.config file with EMPTY values(NOT the default ones) for each setting?! What's the difference between having the settings in the Windows Forms Project or in the class library one? And by the way it is not a operating system issue. It is a Mono issue, because it doesn't work both under Windows and Linux. If I don't use Mono everything is fine, but I have to port my application to Linux, so I have to use Mono. I am really frustrated, it is blocking a project:( Thanks in advance for any suggestion you have. Regards, Petar

    Read the article

  • How do I make the PolicyKit authentication agent window not dissapear when I enter faulty password in Ubuntu 12.04?

    - by Petar
    As far as I remember in previous versions of Ubuntu, whenever authentication was required and when the PolicyKit authentication agent window was presented, it stayed there even after I would enter a faulty password. But now, whenever I make a mistake, the window is closed immediately. I find this behaviour irritating. For instance I use Synaptic rather frequently, and I prefer to start it using Synapse. I press Ctrl+Space to invoke Synapse, then I enter "syn" (s-shows SMplayer, sy- shows System Monitor) and than I press Enter so that Synaptic is invoked. Then I'm presented with the PolicyKit authentication agent window. As my password is rather complicated - using special characters and big letters, it's easy to make a mistake. If I do make a mistake while typing my password, I'm forced to redo all the previous steps. It's annoying as hell, knowing that this is not the way the PolicyKit authentication agent window behaved before. It used to warn me that the password was not correct and than wait for the correct input. I'm not sure if it allowed trying for the correct password indefinitely, or it was limited to 3 retries which is a much saner behaviour than the current one. I'm using Gnome 3, but the same thing happens in Unity too, although the window looks different.

    Read the article

  • iptables rules for botnet (UDP flood) protection

    - by Petar Simeonov
    I'm currently experiencing a massive UDP attack on my server. I host a couple of gameservers, mainly Tf2, CS:GO, CS 1.6 and CS:Source, and my 1.6 server is being flooded. I tried different rules in iptables, but none of them seemed to work. I'm on a 100mbps bandwidth tariff, but the flood i receive is 500+mbps. This is the log of the latest tcpdump - http://pastebin.com/HSgFVeBs Packet length varies throughout the day. Only my gameserver ports are being flooded - 27015, 27016, 27018 via UDP packets. Are there any iptables rules, that might prevent this?

    Read the article

  • Communication between layers in an application

    - by Petar Minchev
    Hi guys! Let's assume we have the following method in the business layer. What's the best practice to tell the UI layer that something went wrong and give also the error message? Should the method return an empty String when it was OK, otherwise the error message, or should it throw another exception in the catch code wrapping the caught exception? If we choose the second variant then the UI should have another try,catch which is too much try,catch maybe. Here is a pseudocode for the first variant. public String updateSomething() { try { //Begin transaction here dataLayer.do1(); dataLayer.do2(); dataLayer.doN(); } catch(Exception exc) { //Rollback transaction code here return exc.message; } return ""; } Is this a good practice or should I throw another exception in the catch(then the method will be void)?

    Read the article

  • Compressing IplImage to JPEG using libjpeg in OpenCV

    - by Petar
    Hi everybody. So I have this problem. I have an IplImage that i want to compress to JPEG and do something with it. I use libjpeg. I found a lot of answers "read through examples and docs" and such and did that. And successfully written a function for that. FILE* convert2jpeg(IplImage* frame) { FILE* outstream = NULL; outstream=malloc(frame-imageSize*frame-nChannels*sizeof(char)) unsigned char *outdata = (uchar *) frame->imageData; struct jpeg_error_mgr jerr; struct jpeg_compress_struct cinfo; int row_stride; JSAMPROW row_ptr[1]; jpeg_create_compress(&cinfo); jpeg_stdio_dest(&cinfo, outstream); cinfo.image_width = frame->width; cinfo.image_height = frame->height; cinfo.input_components = frame->nChannels; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); jpeg_start_compress(&cinfo, TRUE); row_stride = frame->width * frame->nChannels; while (cinfo.next_scanline < cinfo.image_height) { row_ptr[0] = &outdata[cinfo.next_scanline * row_stride]; jpeg_write_scanlines(&cinfo, row_ptr, 1); } jpeg_finish_compress(&cinfo); jpeg_destroy_compress(&cinfo); return outstream; } Now this function is straight from the examples (except the part of allocating memory, but i need that since i'm not writnig to a file), but it still doesn't work. It dies on jpeg_start_compress(&cinfo, TRUE); part? Can anybody help?

    Read the article

  • "Error #1006: getAttributeByQName is not a function." Flex 2.0.1 hotfix 2

    - by Deveti Putnik
    Hi, guys! I am working on some old Flex project (Flex 2.0.1 hotfix 2) and I am rookie in Flex programming. So, I wrote code for accessing some ASP.NET web service: <?xml version="1.0" encoding="utf-8"?> [Bindable] public var users:ArrayOfUser; private function buttonClicked():void { mx.controls.Alert.show(dataService.wsdl); dataService.UserGetAll.send();/ } public function dataHandler(event:ResultEvent):void { Alert.show("alo"); var response:ResponseUsers = event.result as ResponseUsers; if (response.responseCode != ResponseCodes.SUCCESS) { mx.controls.Alert.show("Error: " + response.responseCode.toString()); return; } users = response.users; } ]]> <mx:Button label="Click me!" click="buttonClicked()"/> And this is what I get from debugger: WSDL loaded Invoking SOAP operation UserGetAll Encoding SOAP request envelope Encoding SOAP request body 'A97A2DC1-AEDA-C594-45D2-1BA2B0F3B223' producer sending message '10681130-43E7-3DA7-34DD-1BA2B85545E3' 'direct_http_channel' channel sending message: (mx.messaging.messages::SOAPMessage)#0 body = "<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <tns:UserGetAll xmlns:tns="http://tempuri.org/"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>" clientId = "DirectHTTPChannel0" contentType = "text/xml; charset=utf-8" destination = "DefaultHTTP" headers = (Object)#1 httpHeaders = (Object)#2 SOAPAction = ""http://tempuri.org/UserGetAll"" messageId = "10681130-43E7-3DA7-34DD-1BA2B85545E3" method = "POST" recordHeaders = false timestamp = 0 timeToLive = 0 url = "http://192.168.0.201:8123/Service.asmx" 'A97A2DC1-AEDA-C594-45D2-1BA2B0F3B223' producer acknowledge of '10681130-43E7-3DA7-34DD-1BA2B85545E3'. Decoding SOAP response Encoded SOAP response <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><UserGetAllResponse xmlns="http://tempuri.org/"><UserGetAllResult><ResponseCode>Success</ResponseCode><Users><User><Id>1</Id><Name>test</Name><Key>testKey</Key><IsActive>true</IsActive><Name>Petar i Sofija</Name><Key>123789</Key><IsActive>true</IsActive></User></Users></UserGetAllResult></UserGetAllResponse></soap:Body></soap:Envelope> Decoding SOAP response envelope Decoding SOAP response body And finally I get this error "Error #1006: getAttributeByQName is not a function.". As you can see, I get correct response from web service, but dataHandler function is never got called. Can anyone please help me out? Thanks, Deveti Putnik

    Read the article

1