Daily Archives

Articles indexed Monday May 3 2010

Page 27/107 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • How would you go about parsing markdown?

    - by John Leidegren
    You can find the syntax here. The thing is, the source that follows with the download is written in perl. Which I have no intentions of honoring. It is riddled with regex and it relies on MD5 hashes to escape certain characters. Something is just wrong about that! I'm about to hard code a parser for markdown and I'm wonder if someone had some experience with this? Edit: If you don't have anything meaningful to say about the actual parsing of markdown, spare me the time. (This might sound harsh, but yes, I'm looking for insight, not a solution i.e. third-party library). To help a bit with the answers, regex are meant to identify patterns! NOT to parse an entire grammar. That people consider doing so is foobar. If you think about markdown, it's fundamentally based around the concept of paragraphs. As such, a reasonable approach might be to split the input into paragraphs. There are many kinds of paragraphs e.g. heading, text, list, blockquote, code. The challenge is thus to identify these paragraphs and in what context they occur. I'll be back with a solution, once I find it's worthy to be shared.

    Read the article

  • Gtk, Does deleting builder pointer deletes all the Widgets created using it.

    - by PP
    I am creating builder pointer as follows. GtkBuilder *builder_ptr; builder_ptr = gtk_builder_new(); if( ! gtk_builder_add_from_file(builder_ptr, "Test.glade", &error ) ) printf("\n Error Builder, Exit!\n"); and i am deleting this builder pointer as follows: g_object_unref(G_OBJECT(m_builder)); this builder pointer contains 2-3 GtkWindows and other widgets. So my question is that do i need to delete all the windows in this builder manually when i delete this builder or all the windows will get destroyed when i delete builder pointer. Thanks, PP.

    Read the article

  • Is there a .Net library similar to GNU readline?

    - by paul.moore.name
    I'm considering writing a console application in C# and I want to incorporate history, completion and command line editing features something like GNU readline (but not necessarily as extensive as that!) Is there an existing library for .net which provides this type of functionality? I guess one option would be to use interop services to call GNU readline. But is there a native option?

    Read the article

  • What is the role and purpose of a bootstrapper?

    - by ForeverDebugging
    I'm working on an application which uses a bootscrapper object to perform some operations when the application first starts. e.g. registers IoC objects, puts certain variables into the asp.net Application session object, does some security checks etc. I had a look around the internet and couldn't find a reference to a bootscrapper pattern, or any article about the subject. Is this a known pattern under a different name?

    Read the article

  • Load JSON in Python as header chracterset

    - by mridang
    Hi everyone, I've always found character-sets and encodings complicated to understand and here I'm faced with another problem. My apologies for any inaccuracies. I'll do my best. I'm requesting data from a server which returns JSON. In the HTTP headers it also returns the character.set like so: Content-Type: text/html; charset=UTF-8 I'm using the JSON library in python to load the JSON using the json.loads method. When I pass it the returned JSON, it gives me a dictionary in Unicode. I've Googled around and I know that JSON should return Unicode as JavaScript strings are Unicode objects. How can I load the JSON as UTF-8. I would like to use the same encoding as specified in the response header. I've read this post but it didn't help. Thank you.

    Read the article

  • Problem in reading configuration file from Class library project

    - by Newbie
    If I create an app.config file in a console apps like this <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key ="key1" value ="val1"/> </appSettings> </configuration> and access the same from the console application like object sourcePath = System.Configuration.ConfigurationManager.AppSettings["key1"]; or by object sourcePath = System.Configuration.ConfigurationSettings.AppSettings["key1"]; I am able to get the value. But if I do the same thing in a class library project, I am getting a null value. Why? Where I am making mistake? I have added the proper reference System.Configuration. I am using C# 3.0

    Read the article

  • Passing parameters in VBA for Access

    - by Newbie
    In Access 2007 I have created a form with a textbox and a button. At the moment, when I press the button, I load a query with the textbox data passed as a parameter to the query criteria. I would like to change this so that all (manually input) options appear in a combobox (in place of the textbox). I would then like to pass the combobox text to a VBA module upon pressing the button. How do I do this? Similarly, I hope to output a different string from this module, and I hope to use this as the query criteria. How do I do this?

    Read the article

  • How do I call a method when all threads (backgroundWorkers) are done with their jobs in .NET

    - by claws
    Hello, I'm using C# .NET. Its a GUI application. When user clicks a button work is assigned to 4 different background workers. Each take different amount of time and the end result is they populate some variables. I need to call a method which operates on these end results of each bgwoeker and gives the final output. How to accomplish this? Problem here is to be sure that all bgworkers are done with their job.

    Read the article

  • Bizarre Bug with our Rails app in IE

    - by Callmeed
    We're experiencing a really bizarre bug in our Rails 2.3.4 app. This bug only happens in Internet Explorer (7 and 8). Here's what happens: A new customer creates an account at https://domain.com/signup/free (notice no subdomain) Their account is identified by a subdomain like "example.domain.com" After signing up, they get a welcome screen with a link to their account's home page They follow the link, then click the "log in" button and attempt to login Even though they provide valid credentials, the app redirects back to their account's root url ... they can never reach their admin area The only way they can login (on IE) is by quitting and re-opening IE ... then it works fine ... Something with their initial session is preventing them from logging in. If it matters, we are using restful_authentication and the ssl_requirement plugin ... I'm not sure if one or both of those has a problem with IE but we are stumped here. Also, I've read IE has an issue with subdomains that contain underscores ... this isn't what's going on.

    Read the article

  • Bind ISet in ASP.NET MVC2

    - by Dmitriy Nagirnyak
    Hi, I am trying to find out what would be the best bind first element of ISet (Iesi.Collection) as a first element. So basically I only have to use some kind of collection that has an indexer (and ISet doesn't) then I can write code like this (which works perfectly well): <%: Html.EditorFor(x => x.Company.PrimaryUsers[0].Email) %> But as the ISet has no indexer I cannot use it. So how can I then bind the first element of ISet in MVC2? Thanks, Dmitriy.

    Read the article

  • C#: How to get all public (both get and set) string properties of a type

    - by Svish
    I am trying to make a method that will go through a list of generic objects and replace all their properties of type string which is either null or empty with a replacement. How is a good way to do this? I have this kind of... shell... so far: public static void ReplaceEmptyStrings<T>(List<T> list, string replacement) { var properties = typeof(T).GetProperties( -- What BindingFlags? -- ); foreach(var p in properties) { foreach(var item in list) { if(string.IsNullOrEmpty((string) p.GetValue(item, null))) p.SetValue(item, replacement, null); } } } So, how do I find all the properties of a type that are: Of type string Has public get Has public set ? I made this test class: class TestSubject { public string Public; private string Private; public string PublicPublic { get; set; } public string PublicPrivate { get; private set; } public string PrivatePublic { private get; set; } private string PrivatePrivate { get; set; } } The following does not work: var properties = typeof(TestSubject) .GetProperties(BindingFlags.Instance|BindingFlags.Public) .Where(ø => ø.CanRead && ø.CanWrite) .Where(ø => ø.PropertyType == typeof(string)); If I print out the Name of those properties I get there, I get: PublicPublic PublicPrivate PrivatePublic In other words, I get two properties too much. Note: This could probably be done in a better way... using nested foreach and reflection and all here... but if you have any great alternative ideas, please let me know cause I want to learn!

    Read the article

  • Transfer data between C++ classes efficiently

    - by David
    Hi, Need help... I have 3 classes, Manager which holds 2 pointers. One to class A another to class B . A does not know about B and vise versa. A does some calculations and at the end it puts 3 floats into the clipboard. Next, B pulls from clipboard the 3 floats, and does it's own calculations. This loop is managed by the Manager and repeats many times (iteration after iteration). My problem: Now class A produces a vector of floats which class B needs. This vector can have more than 1000 values and I don't want to use the clipboard to transfer it to B as it will become time consumer, even bottleneck, since this behavior repeats step by step. Simple solution is that B will know A (set a pointer to A). Other one is to transfer a pointer to the vector via Manager But I'm looking for something different, more object oriented that won't break the existent separation between A and B Any ideas ? Many thanks David

    Read the article

  • webapp and django framework

    - by Joel
    As far as I understand, the "Getting Started" guide of GAE with Python uses the webapp framework. However, it seems like it uses Django to render templates. Does that mean that I can use the Django template engine without using its application framework?

    Read the article

  • send the new password - Asp.net - using gmail ( smtp.gmail.com )

    - by user331225
    Hi All, I've gone through all helps and all forums., but none of them have helped me. Here is my problem Developing a site on localhost using ASP.NET 3.5 I want to provide 'forgot password' functionality using <asp:PasswordRecovery> Any real help is greatly appreciated. Please note that I want to send it by either changing web.config OR programatically. Thanks

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >