Search Results

Search found 4473 results on 179 pages for 'mark fish'.

Page 62/179 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • Reading and writing XML over an SslStream

    - by Mark
    I want to read and write XML data over an SslStream. The data (written and read) consists of objects serialized by an XmlSerializer. I have tried the following; (left some details out for clarity!) TcpClient tcpClient = new TcpClient(server, port); SslStream sslStream = new SslStream(tcpClient.GetStream(), true, new RemoteCertificateValidationCallback(ValidateServerCertificate), null); sslStream.AuthenticateAsClient(server); XmlReader xmlReader = XmlReader.Create(sslStream,readerSettings); XmlWriter xmlWriter = XmlWriter.Create(sslStream,writerSettings); myClass c = new myClass (); XmlSerializer serializer = new XmlSerializer(typeof(myClass)); serializer.Serialize(xmlWriter, c); myClass c2 = (myClass )serializer.Deserialize(xmlReader); First of all, it appears that writing to the stream succeeds. But the XmlSerializer throws an error because of invalid XML. It appears that the first character read from the stream is '00' or a null-character. (I have googled this problem, and see a million people with the same 'problem', but no viable solution.) I can work around this 'issue' by using a StreamReader, read everything into a string and then use that string as input for another stream that the serializer can use. (Very dirty, but it works.) Second problem is, that when I try to use the same SslStream to write a second request, I do not get a response from the Reader. (The server DOES send a valid XML response though!) So the serializer.Serialize(xmlWriter, c3) works, but reading from the stream yields no results. I have tried several different classes that implement Stream. (StreamReader, XmlTextReader, etc.) Anyone has an idea how reading and writing XML data to and from an SslStream is supposed to work? Thanks in advance!

    Read the article

  • Can Internet Explorer bind events to absolute positioned elements ?

    - by mark
    Can Internet Explorer bind events to absolute positioned elements ? I can't bind a "click" to an element that is overlapping another. Have tried loads of different ways, here a few tests that don't work in IE: //version 1: $(".classHolder").click(function(){ alert( $(this).html() ); }); //version 2: $(".classHolder").each(function(){ $(this).click(function(){ alert( $(this).html() ); }); }); //version 3: $("#id3").click(function(){ alert( $(this).html() ); }); //version 4: $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); // in all trials I tested with and without: // $("img").unbind(); // $("div").unbind(); // just to make sure no "ghost" events were bind into the elements but no success. // replace all [ for < , and all ] for [html] [head] [script src="http://code.jquery.com/jquery-latest.js"][/script] [script type="application/javascript"] $(document).ready(function(){ $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); }); [/script] [/head] [body] [div id="id1" style="position:relative;"] [img id="id2" src="http://www.google.co.uk/intl/en_com/images/srpr/logo1w.png" style=";z-index:-1;"/] [div id="id3" class="classHolder" style="position:absolute;border:2px solid red;left:0px;top:0px;width:70px;height:70px;z-index:1002;"]G[/div] [div id="id4" class="classHolder" style="position:absolute;border:2px solid red;left:210px;top:0px;width:25px;height:70px;z-index:1001;"]L[/div] asd asdf asdfg [/div] [/body] [/html]

    Read the article

  • reading excell file in vb.net

    - by Mark
    can anyone help me on how to know EOF of excel using vb.net? i have this code but it crash when i try delete the proceeding rows from row 6 to downward. my problem is, my code was still reading a null values of rows that i deleted in excel.. this is my code: Dim xlsConn As New OleDbConnection Dim xlsAdapter As New OleDbDataAdapter Dim xlsDataSet As New DataSet xlsConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0") strSQL = "SELECT * FROM [Sheet1$]" xlsAdapter.SelectCommand = New OleDbCommand(strSQL, xlsConn) xlsDataSet.Clear() xlsAdapter.Fill(xlsDataSet) ListView1.Items.Clear() Dim listItem As ListViewItem For ctr As Integer = 0 To xlsDataSet.Tables(0).Rows.Count - 1 listItem = ListView1.Items.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpNo").ToString) listItem.SubItems.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpName").ToString) Next Can anyone help me to fix this bugs!

    Read the article

  • Intellij-Idea: Marking all files of unknown type be type: text (so that they are searchable)

    - by sixtyfootersdude
    Many of my scripts etc in intellij are marked with a question mark. Then when I click on them them it prompts me: The file "bla" cannot be associated with a registered file type. Please choose one: <insert table of file choices> This would not matter except the files are not searchable (with ctrl-shift-n) until they are marked as text. This is a major problem for me. I have an enormous code base and I don't want to mark all of the unknown files as text. Is there anyway that I can do that? *(Note: I have cross posted this to the intellij form

    Read the article

  • C# Compress Triple Byte Array

    - by Mark
    Hi. I currently got this script, which compresses byte arrays. But I need it rewritten, so it can compress triple byte arrays [,,] Thanks! public static byte[] Compress(byte[] buffer) { MemoryStream ms = new MemoryStream(); GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true); zip.Write(buffer, 0, buffer.Length); zip.Close(); ms.Position = 0; MemoryStream outStream = new MemoryStream(); byte[] compressed = new byte[ms.Length]; ms.Read(compressed, 0, compressed.Length); byte[] gzBuffer = new byte[compressed.Length + 4]; Buffer.BlockCopy(compressed, 0, gzBuffer, 4, compressed.Length); Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gzBuffer, 0, 4); return gzBuffer; } public static byte[] Decompress(byte[] gzBuffer) { MemoryStream ms = new MemoryStream(); int msgLength = BitConverter.ToInt32(gzBuffer, 0); ms.Write(gzBuffer, 4, gzBuffer.Length - 4); byte[] buffer = new byte[msgLength]; ms.Position = 0; GZipStream zip = new GZipStream(ms, CompressionMode.Decompress); zip.Read(buffer, 0, buffer.Length); return buffer; }

    Read the article

  • Comparison of web template engines

    - by Mark
    Post a snippet of code from your favorite templating engine, with the name of the engine and a link to its homepage; show off its basic syntax and maybe some neat features about it that makes it unique. Hopefully this will give people an idea of what's out there and make it easier for them to decide on an engine.

    Read the article

  • DWR and Jquery into spring MVC 2.5

    - by Mark Estrada
    Hi, From my shallow reading, Spring MVC does not support jquery directly. It does enable integration with DWR framework. From my understanding of DWR, it is an ajax framework that allows you to call javas methods from javascript. Can I use both in my application? With Jquery handling most of the javascript code and client side interaction and DWR making the ajax calls? I am leaning towards learning jquery but there is no out of the box support for it in spring 2.5.

    Read the article

  • MFMailComposerViewController doesn't always display attachments

    - by davbryn
    I'm attaching a few files to an email to export from the application I've written, namely a .pdf and a .png. I create these by rendering some view to a context and creating an image and a pdf. I can validate that the files are created properly (I can confirm this by looking in my apps sandbox from Finder, and also by sending the email. I receive the files correctly.) The problem I'm getting is that larger files don't have a preview generated for them within the MFMailComposerViewController view (I simply get a blue icon with a question mark). Is there a limitation on file sizes that can be attached in order for preview to function correctly? With small files it works as expected, but if I try and attach a pdf with the following properties: Pages: 1 Dimensions: 2414 x 1452 Size: 307 KB the file is generated correctly, but displays the question mark icon. If there is no way around that, can I remove the attachment preview altogether? Many thanks, Bryn

    Read the article

  • Roles / Permissions framework for c#?

    - by mark smith
    Hi there, Does anyone know of a good framework to allow me design permission and roles against users. Basically allowing me to automatically check a user can do a certain thing, and then disabling or enabling menu items etc I am not really looking for asp.net security ... as i need to use it in my own service layer and clients both WEB and WPF will use it. I was hoping for something that allows me to create new roles and groups against users and then check what type of permissions a user has or a group has Any help really appreciated.. I am sure some kind of open source framework is available, well i was hoping not having to create my own Thanks

    Read the article

  • .NET /asp.net 4: Changes with automatic NAMES of controls?

    - by mark smith
    Hi there, I just updated an app from .net 2.0 to .net 4.0 and i have noticed the following... For example i have the following control.. <input type="hidden" name="ctl00$cphMain$hfdFueraHorarioOficinaConfirmado" id="cphMain_hfdFueraHorarioOficinaConfirmado" value="False" /> and then in javascript i did this before.. var hfdFueraHorarioOficinaConfirmado=document.getElementById('ctl00_cphMain_hfdFueraHorarioOficinaConfirmado'); but after checking the Id within the html source once it renders and also doing some debugging with firebug etc.... it has changed from ctl00_cphMain_hfdFueraHorarioOficinaConfirmado to cphMain_hfdFueraHorarioOficinaConfirmado can anyone explain why? .... so should i basically do a search and replace and remove the ctl00?????? A little confused Obviosuly the javascript line with the the ctl00_ infront return NULL because it doesn't exist, but removing this returns the object.. Any help or ideas really appreciated Thanks

    Read the article

  • HTML Slideshow plugin

    - by Mark Szymanski
    I am making a website with some screenshots of an iPhone app I made and was wondering if there was some kind of slideshow thing for HTML. I want it to have the iPhone frame and the slideshow with the screenshots in the middle of it. I would prefer it to be written in something other than flash. Thanks in advance!

    Read the article

  • C++: Is there any good way to read/write without specifically stating character type in function nam

    - by Mark L.
    I'm having a problem getting a program to read from a file based on a template, for example: bool parse(basic_ifstream<T> &file) { T ch; locale loc = file.getloc(); basic_string<T> buf; file.unsetf(ios_base::skipws); if (file.is_open()) { while (file >> ch) { if(isalnum(ch, loc)) { buf += ch; } else if(!buf.empty()) { addWord(buf); buf.clear(); } } if(!buf.empty()) { addWord(buf); } return true; } return false; } This will work when I instantiate this class with <char>, but has problems when I use <wchar_t> (clearly). Outside of the class, I'm using: for (iter = mp.begin(); iter != mp.end(); ++iter ) { cout << iter->first << setw(textwidth - iter->first.length() + 1); cout << " " << iter->second << endl; } To write all of the information from this data struct (it's a map<basic_string<T>, int>), and as predicted, cout explodes if iter->first isn't a char array. I've looked online and the consensus is to use wcout, but unfortunately, since this program requires that the template can be changed at compile time (<char> - <wchar_t>) I'm not sure how I could get away with simply choosing cout or wcout. That is, unless there way a way to read/write wide characters without changing lots of code. If this explanation sounds awkwardly complicated, let me know and I'll address it as best I can.

    Read the article

  • Python: Best way to check for Python version in program that uses new language features?

    - by Mark Harrison
    If I have a python script that requires at least a particular version of python, what is the correct way to fail gracefully when an earlier version of python is used to launch the script? How do I get control early enough to issue an error message and exit? For example, I have a program that uses the ternery operator (new in 2.5) and "with" blocks (new in 2.6). I wrote a simple little interpreter-version checker routine which is the first thing the script would call ... except it doesn't get that far. Instead, the script fails during python compilation, before my routines are even called. Thus the user of the script sees some very obscure synax error tracebacks - which pretty much require an expert to deduce that it is simply the case of running the wrong version of python. update I know how to check the version of python. The issue is that some syntax is illegal in older versions of python. Consider this program: import sys if sys.version_info < (2, 4): raise "must use python 2.5 or greater" else: # syntax error in 2.4, ok in 2.5 x = 1 if True else 2 print x When run under 2.4, I want this result $ ~/bin/python2.4 tern.py must use python2.5 or greater and not this result: $ ~/bin/python2.4 tern.py File "tern.py", line 5 x = 1 if True else 2 ^ SyntaxError: invalid syntax (channeling for a coworker)

    Read the article

  • MooTools Classes and JsDoc

    - by Joel Alejandro
    I have the following Moo class: Nem.Ui.Window = new Class({ Implements: [Options, Events], options: { caption: "Ventana", icon: $empty, centered: true, id: $empty, width: $empty, height: $empty, modal: false, desktop: $empty, x: $empty, y: $empty, layout: $empty }, initialize: function(options) { this.setOptions(options); /* ... */ }, setHtmlContents: function(content) { /* ... */ }, setText: function(text) { /* ... */ }, close: function(win) { /* ... */ }, /* ... */ }); I want to document it with JsDoc. I read you can use @lends [class].prototype inside new Class and mark initialize with the @constructs tag. How can I mark methods and events such? I.E.: setHtmlContents should be a method, close should be an event. Also, can the elements under options be documented, somehow?

    Read the article

  • Django: Group by?

    - by Mark
    I'm looking for something like the following: previous_invoices = Invoice.objects.filter(is_open=False).order_by('-created').group_by('user') (group_by() doesn't exist) This would find the most recently closed invoice for each user. This aggregation API seems to let you do stuff like this for counts and sums, but I don't need a count or sum or anything, I actually want the invoice objects!

    Read the article

  • How do I pass a lot of parameters to views in Dango?

    - by Mark
    I'm very new to Django and I'm trying to build an application to present my data in tables and charts. Till now my learning process went very smooth, but now I'm a bit stuck. My pageview retrieves large amounts of data from a database and puts it in the context. The template then generates different html-tables. So far so good. Now I want to add different charts to the template. I manage to do this by defining <img src=".../> tags. The Matplotlib chart is generate in my chartview an returned via: response=HttpResponse(content_type='image/png') canvas.print_png(response) return response Now I have different questions: the data is retrieved twice from the database. Once in the pageview to render the tables, and again in the chartview for making the charts. What is the best way to pass the data, already in the context of the page to the chartview? I need a lot of charts, each with different datasets. I could make a chartview for each chart, but probably there is a better way. How do I pass the different dataset names to the chartview? Some charts have 20 datasets, so I don't think that passing these dataset parameters via the url (like: <imgm src="chart/dataset1/dataset2/.../dataset20/chart.png />) is the right way. Any advice?

    Read the article

  • Background video flash api that can also do html5

    - by Mark
    I'm looking for a way to play flash videos in the background, without controls (yes legitimate reason), and a js api to start/stop the videos easily, like: video1.stop(); or $("div.all-videos").start(); Basically, I'm looking for http://www.happyworm.com/jquery/jplayer/ for video. Soundmanager is basically what I need on the flash side, but it has no html5 support. Is there a flash player that video player that does have html5 video support. Thanks.

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >