Search Results

Search found 252 results on 11 pages for 'sad'.

Page 2/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Displaying an image on a LED matrix with a Netduino

    - by Bertrand Le Roy
    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 for the Fez, another .NET microcontroller. To send data through SPI, we’ll just need  to move a few wires around and update the code. SPI uses pin D11 for writing, pin D12 for reading (which we won’t do) and pin D13 for the clock. The latch pin is a parameter that can be set by the user. This is very close to the wiring we had before (data on D11, clock on D12 and latch on D13). We just have to move the latch from D13 to D10, and the clock from D12 to D13. The code that controls the shift register has slimmed down considerably with that change. Here is the new version, which I invite you to compare with what we had before: public class ShiftRegister74HC595 { protected SPI Spi; public ShiftRegister74HC595(Cpu.Pin latchPin) : this(latchPin, SPI.SPI_module.SPI1) { } public ShiftRegister74HC595(Cpu.Pin latchPin, SPI.SPI_module spiModule) { var spiConfig = new SPI.Configuration( SPI_mod: spiModule, ChipSelect_Port: latchPin, ChipSelect_ActiveState: false, ChipSelect_SetupTime: 0, ChipSelect_HoldTime: 0, Clock_IdleState: false, Clock_Edge: true, Clock_RateKHz: 1000 ); Spi = new SPI(spiConfig); } public void Write(byte buffer) { Spi.Write(new[] {buffer}); } } All we have to do here is configure SPI. The write method couldn’t be any simpler. Everything is now handled in hardware by the Netduino. We set the frequency to 1MHz, which is largely sufficient for what we’ll be doing, but it could potentially go much higher. The shift register addresses the columns of the matrix. The rows are directly wired to ports D0 to D7 of the Netduino. The code writes to only one of those eight lines at a time, which will make it fast enough. The way an image is displayed is that we light the lines one after the other so fast that persistence of vision will give the illusion of a stable image: foreach (var bitmap in matrix.MatrixBitmap) { matrix.OnRow(row, bitmap, true); matrix.OnRow(row, bitmap, false); row++; } Now there is a twist here: we need to run this code as fast as possible in order to display the image with as little flicker as possible, but we’ll eventually have other things to do. In other words, we need the code driving the display to run in the background, except when we want to change what’s being displayed. Fortunately, the .NET Micro Framework supports multithreading. In our implementation, we’ve added an Initialize method that spins a new thread that is tied to the specific instance of the matrix it’s being called on. public LedMatrix Initialize() { DisplayThread = new Thread(() => DoDisplay(this)); DisplayThread.Start(); return this; } I quite like this way to spin a thread. As you may know, there is another, built-in way to contextualize a thread by passing an object into the Start method. For the method to work, the thread must have been constructed with a ParameterizedThreadStart delegate, which takes one parameter of type object. I like to use object as little as possible, so instead I’m constructing a closure with a Lambda, currying it with the current instance. This way, everything remains strongly-typed and there’s no casting to do. Note that this method would extend perfectly to several parameters. Of note as well is the return value of Initialize, a common technique to add some fluency to the API and enabling the matrix to be instantiated and initialized in a single line: using (var matrix = new LedMS88SR74HC595().Initialize()) The “using” in the previous line is because we have implemented IDisposable so that the matrix kills the thread and clears the display when the user code is done with it: public void Dispose() { Clear(); DisplayThread.Abort(); } Thanks to the multi-threaded version of the matrix driver class, we can treat the display as a simple bitmap with a very synchronous programming model: matrix.Set(someimage); while (button.Read()) { Thread.Sleep(10); } Here, the call into Set returns immediately and from the moment the bitmap is set, the background display thread will constantly continue refreshing no matter what happens in the main thread. That enables us to wait or read a button’s port on the main thread knowing that the current image will continue displaying unperturbed and without requiring manual refreshing. We’ve effectively hidden the implementation of the display behind a convenient, synchronous-looking API. Pretty neat, eh? Before I wrap up this post, I want to talk about one small caveat of using SPI rather than driving the shift register directly: when we got to the point where we could actually display images, we noticed that they were a mirror image of what we were sending in. Oh noes! Well, the reason for it is that SPI is sending the bits in a big-endian fashion, in other words backwards. Now sure you could fix that in software by writing some bit-level code to reverse the bits we’re sending in, but there is a far more efficient solution than that. We are doing hardware here, so we can simply reverse the order in which the outputs of the shift register are connected to the columns of the matrix. That’s switching 8 wires around once, as compared to doing bit operations every time we send a line to display. All right, so bringing it all together, here is the code we need to write to display two images in succession, separated by a press on the board’s button: var button = new InputPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled); using (var matrix = new LedMS88SR74HC595().Initialize()) { // Oh, prototype is so sad! var sad = new byte[] { 0x66, 0x24, 0x00, 0x18, 0x00, 0x3C, 0x42, 0x81 }; DisplayAndWait(sad, matrix, button); // Let's make it smile! var smile = new byte[] { 0x42, 0x18, 0x18, 0x81, 0x7E, 0x3C, 0x18, 0x00 }; DisplayAndWait(smile, matrix, button); } And here is a video of the prototype running: The prototype in action I’ve added an artificial delay between the display of each row of the matrix to clearly show what’s otherwise happening very fast. This way, you can clearly see each of the two images being displayed line by line. Next time, we’ll do no hardware changes, focusing instead on building a nice programming model for the matrix, with sprites, text and hardware scrolling. Fun stuff. By the way, can any of my reader guess where we’re going with all that? The code for this prototype can be downloaded here: http://weblogs.asp.net/blogs/bleroy/Samples/NetduinoLedMatrixDriver.zip

    Read the article

  • 302: this blog will be closed

    - by preishuber
    After nearly 7 years I will discontinue blogging on this site. My resources are limited. You can reach my German blog which is used to support my customers. Looking back to a long an interesting journey ASP.NET by ScottGu That was the reason to attend this site and support Microsoft as much as I can. For that I was honored as ASP.NET MVP- thanks again. Meet Scoot several times. Great guy! Forums I have left NNTP forums a few years ago and now Microsoft closed it- It was my idea ;-) AJAX Was the wrong way- JQuery won the game IIS7 That is really a great plattform and the IIS team rules. I am sad that is so silent around that topic. ASP.NET after 2.0 Is no longer my world. I love ASP.NET and ASP.NET Server controls. I hate the discussion about how to follow the holy rules of MVC. Microsoft have dropped the goal to bring ASP.NET to #1 and accepted PHP is it. Facebook & Twittering Microblogging takes over a part of the blogging business. Shorter faster cheaper- or as SteveB mentioned - do more with less. Google Google is taking over the web. I am using Bing every time as I can but Google have more options. Sorry Microsoft you will loose that game. Apple That is not the biggest problem of Microsoft. the Ixxx takes over a small part but big money of the market, but the customers are not strongly linked. New wave new hype- Game over Apple. Silverlight My new home. I can reuse a lot of my skills and love the possibilitys. Silverligth will passing WPF-and strike Flash Windows phone 7 Also my skills fit. I just will use it for fun. I am not really satisfied about what I have heard from MIX. Guys from Redmond, I am sad to say you have been the best Smartphone OS and lost everything. The ADO vNext Story That will be the next mystic point. WCF, REST, JSON, ATOM and now OData. Nothing about SQL commands. LINQ, ORM is also not the final solution for multilayered disconnected async scenarios. Personally I prefere the OData idea and dislike the Swiss Army Knife (German Eierlegende Wollmilchsau) WCF. I am still in INETA Speakers board and I am glad to come to your user group. In all other cases you can hire me over ppedv AG. Good by and have good live.

    Read the article

  • Architecture diagram of a computer virus

    - by Shiraz Bhaiji
    I am looking for an architecture diagram of a computer virus. Does anyone have a link to a good example? Edit Looks like I am getting hammered with downvotes. I agree that there is no single architecture for a virus. But somethings must be included for a program to be a virus. Example for components in the SAD: Replication method Trigger Payload Hosts targeted Vulnerabilities targeted Anti detection method

    Read the article

  • How Much Is Novell's Linux OS Really Worth?

    <b>ServerWatch:</b> "Novell, the parent company of SUSE Linux Enterprise Server, seems to have slapped a huge "For Sale!" sign on its front lawn. It's sad, but this famous enterprise OS maker may soon be little more than a mildly interesting footnote to history."

    Read the article

  • The Linux desktop is already here

    <b>Cyber Cynic:</b> "I found it more than a little sad that someone in 2010 could still think that Linux is "still a non-starter on the desktop." Please &#8212; wake up: We're all Linux desktop users now."

    Read the article

  • The Last Nintendo Power Subscriber

    - by Jason Fitzpatrick
    Nintendo recently announced they were discontinuing gaming magazine Nintendo Power after a 24 year run. Once our moment of sad nostalgia at the news passed we were OK, but not everyone has handled the news so calmly. [via Dorkly] HTG Explains: Why Do Hard Drives Show the Wrong Capacity in Windows? Java is Insecure and Awful, It’s Time to Disable It, and Here’s How What Are the Windows A: and B: Drives Used For?

    Read the article

  • Is the book dead – cheap books

    - by simonsabin
    It was sad to hear today about computermanuals.co.uk closing down after a period of administration. Whilst I do love books, the access to technical information, of high quality on the internet and accessible on your PC does mean the printed technical book does look to be going the way of the dinosaur. The silver lining is that you can get some books really cheap in their closing down sale http://www.computermanuals.co.uk/scripts/search.asp?g=1837...(read more)

    Read the article

  • Should I be running VM's(Virtual Box) for development on the same hdd as my os or a external usb (2.0) HDD or usb (2.0) flash drive

    - by J. Brown
    I have a mac book pro (7200 rpm / 8GB ram) and I like the idea of virtualized development environments as I like to experiment with different technologies and don't like to have environmental cross contamination. I would like to know for the vm's I run (rarely 2 at time..almost always 1 vm at a time) should the virtual hdd be on my laptops native hdd or some external form (usb hdd, usb flash, or since i have mac express card based sad ?). I don't mind maxing out my ram to 16GB if thats a better option to have in the mix. Thank you

    Read the article

  • MIPS return address in main

    - by Alexander
    I am confused why in the code below I need to decrement the stack pointer and store the return address again. If I don't do that... then PCSpim keeps on looping.. Why is that? ######################################################################################################################## ### main ######################################################################################################################## .text .globl main main: addi $sp, $sp, -4 # Make space on stack sw $ra, 0($sp) # Save return address # Start test 1 ############################################################ la $a0, asize1 # 1st parameter: address of asize1[0] la $a1, frame1 # 2nd parameter: address of frame1[0] la $a2, window1 # 3rd parameter: address of window1[0] jal vbsme # call function # Printing $v0 add $a0, $v0, $zero # Load $v0 for printing li $v0, 1 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall # Printing $v1 add $a0, $v1, $zero # Load $v1 for printing li $v0, 1 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall # Print newline. la $a0, newline # Load value for printing li $v0, 4 # Load the system call numbers syscall ############################################################ # End of test 1 lw $ra, 0($sp) # Restore return address addi $sp, $sp, 4 # Restore stack pointer jr $ra # Return ######################################################################################################################## ### vbsme ######################################################################################################################## #.text .globl vbsme vbsme: addi $sp, $sp, -4 # create space on the stack pointer sw $ra, 0($sp) # save return address exit: add $v1, $t5, $zero # (v1) x coordinate of the block in the frame with the minimum SAD add $v0, $t4, $zero # (v0) y coordinate of the block in the frame with the minimum SAD lw $ra, 0($sp) # restore return address addi $sp, $sp, 4 # restore stack pointer jr $ra # return If I delete: addi $sp, $sp, -4 # create space on the stack pointer sw $ra, 0($sp) # save return address and lw $ra, 0($sp) # restore return address addi $sp, $sp, 4 # restore stack pointer on vbsme: PCSpim keeps on running... Why??? I shouldn't have to increment/decrement the stack pointer on vbsme and then do the jr again right? The jal in main is supposed to handle that

    Read the article

  • Should xml represent a set or a list?

    - by sixtyfootersdude
    I always think of xml like a set data structure. Ie: <class> <person>john</person> <person>sarah</person> </class> Is equivalent to: <class> <person>sarah</person> <person>john</person> </class> Question One: Are these two things logicly equivalant? Are you allowed to make things like this in xml? <methodCall> <param>happy</param> <param>sad</param> </methodCall> Or do you need to do it like this: <methodCall> <param arg="1">happy</param> <param arg="2">sad</param> </methodCall> Question Two: Are these two things logically equivalent? Question Three: Is xml usually treated like a set or a list?

    Read the article

  • Blocking ports in Airport Express

    - by gok
    I want to block torrent and other file sharing apps from Airport Express. How could I achieve this? I am not asking the port numbers. It's so sad that Airport Express is a very closed system. I miss my old Alcatel router in which every setting was possible.

    Read the article

  • "I'm Feeling Lucky"-style behavior in Windows 8.1 search?

    - by vorou
    Is it possible to make Windows 8.1 automatically select the most relevant search result, so that I could just press Enter to execute it? Right now, I have to press down-arrow each time to select it, and then press Enter. I occasionally forget to press the down-arrow, and Windows opens that very useful Search Results window for me. It makes me sad since I'm absolutelly happy with the top search result nearly all the time. P.S.: I'm taking about the Search in Start menu (the menu which opens when I press winkey)

    Read the article

  • Looking Back at MIX10

    Its the sad truth of my life that even though Im fascinated by airplanes and flight in general since my childhood days, my body doesnt like flying. Even the ridiculously short flights inside Germany are taking their toll on me each time. Now combine this with sitting in the cramped space of economy class for many hours on a transatlantic flight from Germany to Las Vegas and back, and factor in some heavy dose of jet lag (especially on my way eastwards), and you get an idea why after coming back...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How Do I Export Pages from Browser with Embedded Hyperlinks?

    - by Volomike
    Made a sad discovery today. I have Ubuntu 10.04 LTS. My client is in the ad business and she had a marketing competition task for me. She wanted me to visit websites of the competitors, and export the home pages as PDF. However, she wanted me to do so with embedded hyperlinks. As it turns out, Firefox (and even the latest Chrome) on Ubuntu 10.04 LTS do not embed hyperlinks in PDF web page exports. Sure, there are several Chrome and FF plugins that let you export as PDF, but what these do is connect to the URL remotely, generate the PDF remotely, and then force a download in your browser to download it from a remote location. That's not good for me, though, because some of these competitor pages require an initial login. That means that all I get back on the PDF printing from these FF or Chrome plugins is a login page. Is there a way to get around this problem, to fix the broken PDF printer on Ubuntu 10.04?

    Read the article

  • OT: Airlines and Podcasts

    - by Greg Low
    Those that know me know that I spend an inordinate amount of time on airlines. I also love podcasts, as you can tell from my www.sqldownunder.com site and show. So anything that combines the two is just awesome. Fly With Joe fits that perfectly. Joe D'Eon provides great insights in his show. I was sad last year that he hadn't posted many shows. I've also been quiet for a couple of months (but that's about to change with a bunch of SQL Server 2008 R2 shows). But I've been so pleased that Joe's got...(read more)

    Read the article

  • Dear ISV: You’re Keeping Me Awake Nights with Your VARCHAR() Dates

    - by merrillaldrich
    I generally sleep well and deeply. My wife and I once went to sleep, back when we lived in the Heights neighborhood in Houston, and when we woke up the next day, the house across the street had been removed . We never heard a thing. However, tonight it’s 3 AM here in Seattle and I am wide awake writing to you about data types. Why? Because a software vendor is making me crazy with their database schema. This is sad and wrong on many levels, but there it is. It’s harder, I think, to be held responsible...(read more)

    Read the article

  • Ipod scrobbling to last.fm?

    - by Crud Mucosa
    The Amarok 1.4 series scrobbled the songs I played via ipod (and also had great ipod song transfer functionality). I've not been able to scrobble songs played via my ipod then synced to a media player since my upgrade to 11.10 (and the subsequent total loss of Amarok 1.4). I see various media players (clementine, banshee) have requests in for this feature but I'd like to believe that something, somewhere has ipod scrobbling in Ubuntu! Was the 1.4 series of Amarok the only thing that had it? Good music management is one of the main reasons I've used Linux (besides stability, clean interfaces, ease of development, etc). The lack of ipod scrobbling to last.fm makes me a very sad panda.

    Read the article

  • Avoiding That Null Reference!

    - by TheJuice
    A coworker had this conversation with another of our developers. Names have been changed to protect the guilty. Clueless: hey! Clueless: I am using the ?? operator for null check below Nice Guy: hey Clueless: FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral ?? null; Nice Guy: that's not exactly how it works Clueless: I want to achive: FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral != null ? request.BoatCollateral : null; Clueless: isnt that equal to:  FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral ?? null; Nice Guy: that is functionally equivalent to FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral Nice Guy: you're checking if it's null and if so setting it to null Clueless: yeah Clueless: if its null I want to set it to null Nice Guy: if it's null then you're already going to set it to null, no special logic needed Clueless: I wanted to avoid a null reference if BoatCollateral is null   The sad part of all of this is that "Clueless" has been with our company for years and has a Master's in Computer Science.

    Read the article

  • What's up with all the updates? [closed]

    - by Bob Babb
    I use Ubuntu exclusively for my job, especially for the fact that everything works and I get the most out of my processor and memory, but you are killing me with updates! I just lost a very good opportunity from a client that installed Ubuntu but got tired of all the updates. I really can't argue the fact. In a matter of a day I had two software updates. Quote from customer: "It's sad that I come in at 6:00 in the morning to install updates from a LTS version, and then before I leave at the end of the day I have 19 new updates to install. At least Microsoft bundles them in controllable groups." Sadly I have to agree, guys you have to do something about this. Please!

    Read the article

  • Year 2012 So Far...

    - by rajeshr
    It's hard to seek excuses for not showing up in here for regular updates. I'm not venturing into it hence. Year 2012 has been very engaging, both professionally and personally, and I wish to present before you some wonderful people whom I met in the OU classrooms while delivering training programs on various Oracle technologies. While I went through a number of Oracle products in the last few months, two of 'em were more regular than others: Solaris 11 and MySQL. Not to forget the First Global Teach Live Virtual Class on Java ME. Oracle Solaris 11 Training in Bangalore Oracle Solaris 11 Training in Delhi Oracle Solaris 11 Training in Hyderabad Oracle VM for SPARC Training at OU Hong Kong Oracle VM for SPARC Training at Bangalore Oracle Solaris 11 Training in Bangalore Oracle Solaris 10 Training in Bangalore Oracle Solaris 11 Training in Delhi MySQL training Programs at Kochi, Kerala. Attending Ofir Leitner's Pilot teach on Java ME Oracle Solaris 11 Training in Bangalore Sad, I don't have photographs of some smart people whom I came across in my live virtual classes on various Oracle technologies

    Read the article

  • Large resolution differences

    - by Robin Betka
    I want to develop a game on multiple devices such as PC, Android or IOS. Want it to be in 1080p, but that means a massive scale down for the smartphones. I know how to do that, just render everything on a 1080p rendertarget and then render it on the screen smaller. But what should I do so that the scalling down doesn't look bad and blury? I can't do it vector based or anything because the sprites simply need a specific size. Should I make the sprites power of two size to get some nice mipmapping? And which other settings can I do? Or should I rather go with a lower resolution but then having a little bit worse look PC version? The performance seems not to be a problem for me, so would be sad not using 1080p because of other problems.

    Read the article

  • Dell wireless not working after upgrade

    - by Omer Saeed
    So, the short version of my sad story is that I tried upgrade Ubuntu to 12.04 and wireless driver has stopped working. I have tried all the solutions but nothing seem to be working. When I try to install my wireless from "Additional Drivers" Its says: Sorry, installation of this driver failed. Please have a look at the log file for details: /var/log/jockey.log The lspci command gives me the following info about wireless: 0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01) I have tried removing bcm drivers and reinstalling, but nothing seems to be working. rfkill is good too.

    Read the article

  • How can I enable auto-switching HDMI sound on Ubuntu 12.04?

    - by João Ciocca
    I've just installed Ubuntu 12.04 on my Lenovo G550 notebook and decided to test the main thing I use it for, on Windows: watching movies and series on my living room TV. Plugged in the HDMI cable, screen auto-configured nicely - awesome. But the sound is coming through my notebook's speakers, instead of my TV. Searched for almost an hour on Google, found a couple of things - nothing that helped, though. Here are two links that made me sad: Another question on AskUbuntu "a better sounding world" post about HDMI On 2, David says that autoswitching was disabled... so how can I enable it?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >