Top ASP.NET Items

Sponsors

Browse by Tags

All Tags » C# (RSS)
PIX-6T4, the DIY console, has an Orchard site
If you're a regular reader of this blog, you may have noticed the electronics posts lately. With my friend Fabien , we've been building a little handheld console from readily available parts. It's also programmable in C#, using a library that we built . It's great fun really. Our plan is to build a kit and a book out of it, to help people learn the basics of digital electronics and C# programming. We've built a site for the project over a few nights last week, using Orchard and hosting on Azure . I thought I'd throw in a little return on experience and talk about the modules we used. The site can be found here: http://www.pix6t4.com The first thing I did to build the site was to build the theme. I started from the built...
So what are zones really?
There is a (not so) particular kind of shape in Orchard: zones. Functionally, zones are places where other shapes can render. There are top-level zones, the ones defined on Layout, where widgets typically go, and there are local zones that can be defined anywhere. These local zones are what you target in placement.info . Creating a zone is easy because it really is just an empty shape. Most themes include a helper for it: Func<dynamic, dynamic> Zone = x => Display(x); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd...
Creating shapes on the fly
Most Orchard shapes get created from part drivers, but they are a lot more versatile than that. They can actually be created from pretty much anywhere, including from templates. One example can be found in the Layout.cshtml file of the ThemeMachine theme: WorkContext.Layout.Footer .Add(New.BadgeOfHonor(), "5" ); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background...
Adding RSS to tags in Orchard
A year ago, I wrote a scary post about RSS in Orchard . RSS was one of the first features we implemented in our CMS , and it has stood the test of time rather well, but the post was explaining things at a level that was probably too abstract whereas my readers were expecting something a little more practical. Well, this post is going to correct this by showing how I built a module that adds RSS feeds for each tag on the site. Hopefully it will show that it's not very complicated in practice, and also that the infrastructure is pretty well thought out. In order to provide RSS, we need to do two things: generate the XML for the feed, and inject the address of that feed into the existing tag listing page, in order to make the feed discoverable...
Taking over list rendering in Orchard
A task that is likely to pop-up oftentimes when customizing an Orchard theme for a project is list rendering. Two types of shapes will typically be at work when rendering a list in Orchard: the summary shape and the list shape. The list shape itself will rarely vary as the semantics of a list pretty much mandate the use of a simple UL/LI decorated with CSS classes. It's so simple in fact that it's not even rendered by a template but by a C# shape method in CoreShapes.cs. The summary shapes can be rendered by templates that are specialized by content type and by display type. That covers most cases of list customization. In a few rare cases though, you'll want to simply take over the rendering of a specific list completely. In my...
Driving a LED matrix from a Netduino one more time: The Right Way
In previous posts, we've seen two ways one can drive a small LED matrix from a Netduino . The first time , we just turned the rows and columns of the matrix on and off using digital ports on the Netduino. With this method, we have great control for sure, but it's no good for the following reasons. It's very slow: the digital ports on the microcontroller don't switch very fast. What kills it though is that we don't have enough digital ports on the Netduino: for an 8x8 matrix, you would need 16 ports and we only have 14. not to mention the final system we're building will need some ports for other things than display. With the second and third posts, we used a shift register. The way you talk to a shift register is that...
Displaying an image on a LED matrix with a Netduino
In the previous post , we’ve been flipping bits manually on three ports of the Netduino to simulate the data, clock and latch pins that a shift register expected. We did all that in order to control one line of a LED matrix and create a simple Knight Rider effect. It was rightly pointed out in the comments that the Netduino has built-in knowledge of the sort of serial protocol that this shift register understands through a feature called SPI. That will of course make our code a whole lot simpler, but it will also make it a whole lot faster: writing to the Netduino ports is actually not that fast, whereas SPI is very, very fast. Unfortunately, the Netduino documentation for SPI is severely lacking. Instead, we’ve been reliably using the documentation...
FluentPath 1.0
Last Sunday, I published version 1.0 of my little FluentPath library . This library, which is a fluent wrapper around System.IO, started as a little experiment / code sample and has been met with some enthusiasm from some of you so I spent quite a bit of time over the last few months polishing it and trying to raise it to a level of quality where it can safely be used in real applications (although my lawyer is telling me that it’s still at your own risk, as specified in the license ). I’ve started using it myself on a few projects and it’s now my default way of accessing the file system. So what’s in there and why should you use it? It’s small! 36kB dll, no dependencies. It’s a NuGet! You can now install FluentPath with NuGet: It’s robust!...
More Netduino fun
Last time, we ran a very simple program on the Netduino. This time around, we’ll actually connect some real hardware to that microcontroller and blink some lights! You know what? Let’s go crazy! Let’s go for Knight Rider lights ! Woohoo! Ahem. Yeah. Well, you’ve got to start small. Anyway, I have this LED array that I’m going to build a little something on soon. This time, we’ll just use a single line for that simple effect. The LED array can be found here: http://futurlec.com/LEDMatrix.shtml for $1.80, which is ridiculous. It’s the LEDMS88R. A LED array is a very simple piece of hardware: it’s just LEDs at each intersection of line and column wires: To turn on one of the LEDs, just send some juice between the right line and column. You can...
Hello Netduino!
We’re makers, all of us, we build stuff for work and pleasure. Software development is a great discipline for people like us as the ticket to entry is relatively modest. All you need is a computer and that is pretty much it. There is no real limit to what you can do. Today, hobbyist electronics are blooming thanks to the availability of the universal logical components that are microcontrollers. Open-source hardware platforms such as the Arduino give anyone the ability to build pretty much anything they can think of for a few dozen dollars. Microcontrollers are for all practical intents and purposes small computers with a bunch of digital and analogic inputs and outputs. They are more powerful than the multi-hundred dollars Ataris and Commodores...
More Posts Next page »