Entries:
Comments:
Discussions:

Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

sysrpl sysrpl
  • ASP.NET templating system

    Last week while reading about WebForms at MSDN I came across this example in the documentation:

    <asp:Repeater ID="ProductList" runat="server">
        <ItemTemplate>
            <%# Eval("Name") %> for only <%# Eval("Price", "{0:c}") %>
            <br />
            <a href='<%# Eval("ProductID", "details.asp?id={0}") %>'>See Details</a>
            <br />
            <br />
        </ItemTemplate>
    </asp:Repeater>

    Which spurred me to create a comparison of how this would look using my template system:

    {Name} for only {Price:C}
    <br />
    <a href="details.asp?id={ProductID}">See Details</a>
    <br />
    <br />

    Which is much cleaner IMO. 

    Image of templates organized in an IDE

    Edit: Here is the templating source code 

  • Tell me why I should use web framework X?

    @vesuvius: you (me) are a "dumbass"

     Lol, fair enough I suppose. I read through your comment and those of others. I guess my point my be is that what I have works well for what I need, is so damn simple, and quick. If I need some extra something, it's easy to add it in since I wrote it, and the results (which is where I want to be) turn out better than what I wanted to begin with. I am having a hard time imagining what I need in a framework that I already don't have.

    Again check out my reference site at the top in the original message. It does exactly what I wanted in the most straight forward implementation I could imagine using.

     

     

  • Tell me why I should use web framework X?

    I created a simplified overview of my custom asp framework based on a vanilla System.Object. I haven't used to much extent any C# web frameworks (besides dev.express xaf which i abhor). If anyone cares to help, look briefly at this overview of my framework and tell me why I should be using framework X instead?

    Reference website with framework in action:

    http://www.dotaplayer.info

    /* BasicHandler derives from System.Object. 
    provides caching of include files based on file modified stamps, safe (escaping html) 
    reading of post/get data through my IFiler interface, sending of files as response, 
    redirection enhancements, basic in memory logging, template file insertion */
    public abstract class BasicHandler : IHttpHandler {}
    /* TemplateHandler provides base support for template pages including 
    master detail templates and multiple templates per handler */
    public abstract class TemplateHandler : BasicHandler {}
    /* DataTemplate provides support for templates binding to sql data object collections,
    good for detail records originating from a database which need templates */
    public class DataTemplate : TemplateHandler { }
    /* PageHandler provides pages methods and default page, this is the base class for
    any page you would load */
    public class PageHandler : BasicHandler { }
    /* DocumentHandler for returning xml or json data */
    public abstract class DocumentHandler : BasicHandler { }
    /* FormatExtensions provide a state engine which parses templates (a string) and 
    binds to any object */
    public static class FormatExtensions { }
    /* DataCommand provides simplified database access, manages connection and 
    things which need disposing */
    public class DataCommand { }

    Page examples:

    [DefaultPage("/WebPages/hello.html")]
    public class HelloWorldPage : PageHandler
    { 
        [MethodPage("speak")]
        public void SpeakMethod()
        {
            Write("Hello There {0}!", ReadString("name"));
        }
    
        [MethodPage("status")]
        public void StatusMethod()
        {
            WriteTemplate<StatusTemplate>();
        }
    }
    // execute using ?method=speak&name=freddy and ?method=status
    // no method returns hello.html

    Template example:

    Hero.template

    <a id="hero-{Id}" name="{Name}" onclick="return clickHero({Id});">
    <span class="heroKind{Kind}"></span>
    <img src="{ImageMedium}">
    <span class="heroLabel">{Name}</span>
    <span class="heroTags">{Tag}</span>
    </a>

    Hero.template.cs

    [Cached, Template("Hero")]
    public class HeroTemplate : TemplateHandler
    {
        protected override void Run(StringBuilder output, Templates templates)
        {
            var template = templates["Hero"];
            foreach (var hero in Lookups.Heroes
                .Where(hero => hero.Id > -1)
                .OrderBy(hero => hero.Name))
                output.Append(template.FormatObject(hero));
        }
    }

    Data access examples:

    using (var reader = DataCommand.Prepare(selectItemSummarySql)
        .Add("@name", name)
        .ExecuteReader())
        while (reader.Read())
            list.Add(new ItemData(reader));
    long playerId = Api.SteamToPlayer(filer.ReadLong("steamid"));
    DataCommand.Prepare(insertPlayerSql)
        .Add("@player_id", playerId)
        .Add("@name", filer.ReadString("personaname"))
        .Add("@avatar", filer.ReadString("avatar"))
        .Add("@country_code", filer.ReadString("loccountrycode"))
        .Add("@created", filer.ReadLong("timecreated"))
        .ExecuteNonQuery();
    // both selectItemSummarySql and insertPlayerSql are paths to (cached) resources 
    // included in the project

  • Chromecast

    Plex media software now has Chromecast support. Here is a recent demo:

    http://www.youtube.com/watch?v=9yXTQN-IXxQ

  • The world's hardest riddle

    I turn polar bears white
    and I will make you cry.
    I make guys have to pee
    and girls comb their hair.
    I make celebrities look stupid
    and normal people look like celebrities.
    I turn pancakes brown
    and make your champane bubble.
    If you squeeze me, I'll pop.
    If you look at me, you'll pop.
    Can you guess the riddle?

    97% of Harvard graduates can not figure this riddle out, but 84% of kindergarten students were able to figure this out in 6 minutes or less. Can you guess the correct answer? Just repost this bulletin with the title "The World's Hardest Riddle", and then check your inbox. You'll get a message with the correct answer in it. Good luck!

    I believe the answer is NO! The last line in the riddle says "Can you guess the riddle? and most kindergartens would answer no.

  • XKeyscore - Screen shots of NSA search tools

    Here is more information regarding XKeyscore from a top secret presentation created in 2008:

    http://www.theguardian.com/world/interactive/2013/jul/31/nsa-xkeyscore-program-full-presentation

    It would seem that the NSA likes searching your word and excel documents, especially if you do something suspicious like use encryption. 

  • XKeyscore - Screen shots of NSA search tools

    Edward Snowden via Glen Greenwald shed more light today on what he meant when he said given an email address he could wiretap anyone:

    http://www.theguardian.com/world/2013/jul/31/nsa-top-secret-program-online-data

    What's interesting here is seeing the actual NSA analyst search forms which are simple browser based applications. An analyst fills out a keyword, email address or website name (wildcards can be used) and select a search reason from a limited drop list, then clicks "submit" and he/she can find out a whole lot about you. This includes your web browsing history, online chats, emails, locations you've logging in from. All this is done without a warrant.

    Discuss

  • I published an XNA style game toolkit

    @Ion Todirel:

    It targets free pascal only.

    But don't let that stop you, as fp has added a lot of new language features like:

    • implcit/explict conversions
    • Value types can have methods, operators, and everything a class can have (except virtual methods, interface implementation)
    • extension methods (again applies to value types as well as classes)
    • c++ style operators (++,--,+=.*=, ect)
    • operator overloading
    • inlining code
    • generics with constraints
    • much improved reflection (they call it rtti)
    • managed types (dynamic arrays, interfaces, dynamics)
    • and a lot more

    It also is native code which is great for interfacing with the open source software it is build on (sdl2, opengl, openssl, libxml). Direct memory pixel (use for sprite collision) or vertex buffer (vertex data is a pointer to a user defined data in memory) access is very easy.

    Also it includes the Lazarus IDE which I briefly overview in this video, includes stepping into dlls C code where you can see what the other open source frameworks are doing:

    http://www.baregame.org/#topic_using_lazarus

  • I published an XNA style game toolkit

    To the regulars,

    I've been working on project which recreates an XNA style game toolkit, except for every (soon!) platform.  I thought maybe this long holiday weekend some people somewhere might look at it and give me feedback (watch the video):

    http://www.baregame.org/

    The class library written around SDL 2.0 and optionally includes a compiler+IDE as well as recent binaries of SDL 2.0 for 32/64 bit Windows an Linux.

    And when I say modern I mean the library features a lot of C# ness to it (even though it's not C#) ...

    e.g.

    TEventHandler<T> = procedure(Sender: TObject; var Args: T) of object;
    IBitmap = interface(IClonable<IBitmap>)
    TPointF = record public class operator Implicit(const Value: TPointI): TPointF;
    TMatrix4x4 = record public class operator Multiply(const A: TMatrix4x4; const B: TVec3): TVec3; overload;

    namespace Bare.System:

    https://github.com/sysrpl/Bare.Game/blob/master/source/bare.game.pas

    If you look at the site, please bear in mind i haven't had time to write up everything yet. Let me know what you think.

  • Can someone PLEASE tell me why Windows file operations are still messed up?

    I don't have a virus scanner. I turn off Windows defender right after I install (along with windows firewall). I don't install much on my PCs, just textpad (I own a license), vcl, google chrome, and mingw on dev machines or utorrent (downloading mp4 movies) on my htpc.

    I also re-install about a year or every other year. I've had these problems constantly on a lot of machines, and most of the people at my work who I've discussed this with have similar experiences.

    I guess I could screen record some videos on a few different machines if people don't believe me.