Search Results

Search found 3598 results on 144 pages for 'joe coder guy'.

Page 7/144 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • LINQ to Twitter Queries with LINQPad

    - by Joe Mayo
    LINQPad is a popular utility for .NET developers who use LINQ a lot.  In addition to standard SQL queries, LINQPad also supports other types of LINQ providers, including LINQ to Twitter.  The following sections explain how to set up LINQPad for making queries with LINQ to Twitter. LINQPad comes in a couple versions and this example uses LINQPad4, which runs on the .NET Framework 4.0. 1. The first thing you'll need to do is set up a reference to the LinqToTwitter.dll. From the Query menu, select query properties. Click the Browse button and find the LinqToTwitter.dll binary. You should see something similar to the Query Properties window below. 2. While you have the query properties window open, add the namespace for the LINQ to Twitter types.  Click the Additional Namespace Imports tab and type in LinqToTwitter. The results are shown below: 3. The default query type, when you first start LINQPad, is C# Expression, but you'll need to change this to support multiple statements.  Change the Language dropdown, on the Main window, to C# Statements. 4. To query LINQ to Twitter, instantiate a TwitterContext, by typing the following into the LINQPad Query window: var ctx = new TwitterContext(); Note: If you're getting syntax errors, go back and make sure you did steps #2 and #3 properly. 5. Next, add a query, but don't materialize it, like this: var tweets = from tweet in ctx.Status where tweet.Type == StatusType.Public select new { tweet.Text, tweet.Geo, tweet.User }; 6. Next, you want the output to be displayed in the LINQPad grid, so do a Dump, like this: tweets.Dump(); The following image shows the final results:   That was an unauthenticated query, but you can also perform authenticated queries with LINQ to Twitter's support of OAuth.  Here's an example that uses the PinAuthorizer (type this into the LINQPad Query window): var auth = new PinAuthorizer { Credentials = new InMemoryCredentials { ConsumerKey = "", ConsumerSecret = "" }, UseCompression = true, GoToTwitterAuthorization = pageLink => Process.Start(pageLink), GetPin = () => { // this executes after user authorizes, which begins with the call to auth.Authorize() below. Console.WriteLine("\nAfter you authorize this application, Twitter will give you a 7-digit PIN Number.\n"); Console.Write("Enter the PIN number here: "); return Console.ReadLine(); } }; // start the authorization process (launches Twitter authorization page). auth.Authorize(); var ctx = new TwitterContext(auth, "https://api.twitter.com/1/", "https://search.twitter.com/"); var tweets = from tweet in ctx.Status where tweet.Type == StatusType.Public select new { tweet.Text, tweet.Geo, tweet.User }; tweets.Dump(); This code is very similar to what you'll find in the LINQ to Twitter downloadable source code solution, in the LinqToTwitterDemo project.  For obvious reasons, I changed the value assigned to ConsumerKey and ConsumerSecret, which you'll have to obtain by visiting http://dev.twitter.com and registering your application. One tip, you'll probably want to make this easier on yourself by creating your own DLL that encapsulates all of the OAuth logic and then call a method or property on you custom class that returns a fully functioning TwitterContext.  This will help avoid adding all this code every time you want to make a query. Now, you know how to set up LINQPad for LINQ to Twitter, perform unauthenticated queries, and perform queries with OAuth. Joe

    Read the article

  • Cocos2d - smooth sprite movement in tile map RPG

    - by Lendo92
    I've been working on a 2-D Gameboy style RPG for a while now, and the game logic is mostly all done so I'm starting to try to make things look good. One thing I've noticed is that the walking movement / screen movement is a little bit choppy. Technically, it should work fine, but either it seems to be having some quirks, either due to taking up a lot of processing power or just timing inconsistencies between moving the screen and moving the sprite. To move the sprite, once I know where I want to move it, I call: tempPos.y += 3*theHKMap.tileSize.width/5; id actionMove = [CCMoveTo actionWithDuration:0.1 position:tempPos]; id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(orientOneMove)]; [guy runAction:[CCSequence actions:actionMove, actionMoveDone, nil]]; [self setCenterOfScreen:position]; Then, in orientOneMove, I call: [self.guy setTexture:[[CCTextureCache sharedTextureCache] addImage:@"guysprite07.png"]]; //the walking picture-I change texture back at the end of the movement id actionMove = [CCMoveTo actionWithDuration:0.15 position:self.tempLocation2]; id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(toggleTouchEnabled)]; [guy runAction:[CCSequence actions:actionMove, actionMoveDone, nil]]; The code for the concurrently running setCenterOfScreen:position method is: id actionMove = [CCMoveTo actionWithDuration:0.25 position:difference]; [self runAction: [CCSequence actions:actionMove, nil, nil]]; So the setCenterOfScreen moves the camera in one clean move while the guy moving is chopped into two actions to animate it (which I believe might be inefficient.) It's hard to tell what is making the movement not perfectly clean from looking at it, but essentially the guy isn't always perfectly in the center of the screen -- during movement, he's often times a pixel or two off for an instant. Any ideas/ solutions?

    Read the article

  • Comments on Comments

    - by Joe Mayo
    I almost tweeted a reply to Capar Kleijne's question about comments on Twitter, but realized that my opinion exceeded 140 characters. The following is based upon my experience with extremes and approaches that I find useful in code comments. There are a couple extremes that I've seen and reasons why people go the distance in each approach. The most common extreme is no comments in the code at all.  A few bad reasons why this happens is because a developer is in a hurry, sloppy, or is interested in job preservation. The unfortunate result is that the code is difficult to understand and hard to maintain. The drawbacks to no comments in code are a primary reason why teachers drill the need for commenting code into our heads.  This viewpoint assumes the lack of comments are bad because the code is bad, but there is another reason for not commenting that is gaining more popularity. I've heard/and read that code should be self documenting. Following this thought pattern, if code is well written with meaningful names, there should not be a reason for comments.  An addendum to this argument is that comments are often neglected and get out-of-date, but the code is what is kept up-to-date. Presumably, if code contained very good naming, it would be easy to maintain.  This is a noble perspective and I like the practice of meaningful naming of identifiers. However, I think it's also an extreme approach that doesn't cover important cases.  i.e. If an identifier is named badly (subjective differences in opinion) or not changed appropriately during maintenance, then the badly named identifier is no more useful than a stale comment. These were the two no-comment extremes, so let's look at the too many comments extreme. On a regular basis, I'll see cases where the code is over-commented; not nearly as often as the no-comment scenarios, but still prevalent.  These are examples of where every single line in the code is commented.  These comments make the code harder to read because they get in the way of the algorithm.  In most cases, the comments parrot what each line of code does.  If a developer understands the language, then most statements are immediately intuitive.  i.e. what use is it to say that I'm assigning foo to bar when it's clear what the code is doing. I think that over-commenting code is a waste of time that slows down initial development and maintenance.  Understandably, the developer's intentions are admirable because they've had it beaten into their heads that they must comment. However, I think it's an extreme and prefer a more moderate approach. I don't think the extremes do justice to code because each can make maintenance harder.  No comments on bad code is obviously a problem, but the other two extremes are subtle and require qualification to address properly. The problem I see with the code-as-documentation approach is that it doesn't lift the developer out of the algorithm to identify dependencies, intentions, and hacks. Any developer can read code and follow an algorithm, but they still need to know where it fits into the big picture of the application. Because of indirections with language features like interfaces, delegates, and virtual members, code can become complex.  Occasionally, it's useful to point out a nuance or reason why a piece of code is there. i.e. If you've building an app that communicates via HTTP, you'll have certain headers to include for the endpoint, and it could be useful to point out why the code for setting those header values is there and how they affect the application. An argument against this could be that you should extract that code into a separate method with a meaningful name to describe the scenario.  My problem with such an approach would be that your code base becomes even more difficult to navigate and work with because you have all of this extra code just to make the code more meaningful. My opinion is that a simple and well-stated comment stating the reasons and intention for the code is more natural and convenient to the initial developer and maintainer.  I just don't agree with the approach of going out of the way to avoid making a comment.  I'm also concerned that some developers would take this approach as an excuse to not comment their bad code. Another area where I like comments is on documentation comments.  Java has it and so does C# and VB.  It's convenient because we can build automated tools that extract these comments.  These extracted comments are often much better than no documentation at all.  The "go read the code" answer always doesn't fulfill the need for a quick summary of an API. To summarize, I think that the extremes of no comments and too many comments are less than desirable approaches. I prefer documentation comments to explain each class and member (API level) and code comments as necessary to supplement well-written code. Joe

    Read the article

  • PASS Summit 2010 Recap

    - by AjarnMark
    Last week I attended my eighth PASS Summit in nine years, and every year it is a fantastic event!  I was fortunate my first year to have a contact (Bill Graziano (blog | Twitter) from SQLTeam) that I was expecting to meet, and who got me started on a good track of making new contacts.  Each year I have made a few more, and renewed friendships from years past.  Many of the attendees agree that the pure networking opportunities are one of the best benefits of attending the Summit.  And there’s a lot of great technical stuff, too, some of the things that stick out for me this year include… Pre-Con Monday: PowerShell with Allen White (blog | Twitter).  This was the first time that I attended a pre-con.  For those not familiar with the concept, the regular sessions for the conference are 75-90 minutes long.  For an extra fee, you can attend a full-day session on a single topic during a pre- or post-conference training day.  I had been meaning for several months to dive in and learn PowerShell, but just never seemed to find (or make) the time for it, so when I saw this was one of the all-day sessions, and I was planning to be there on Monday anyway, I decided to go for it.  And it was well worth it!  I definitely came out of there with a good foundation to build my own PowerShell scripts, plus several sample scripts that he showed which already cover the first four or five things I was planning to do with PowerShell anyway.  This looks like the right tool for me to build an automated version of our software deployment process, which right now contains many repeated steps.  Thanks Allen! Service Broker with Denny Cherry (blog | Twitter).  I remembered reading Denny’s blog post on Using Service Broker instead of Replication, and ever since then I have been thinking about using this to populate a new reporting-focused Data Repository that we will be building in the near future.  When I saw he was doing this session, I thought it would be great to get more information and be able to ask the author questions.  When I brought this idea back to my boss, he really liked it, as we had previously been discussing doing nightly data loads, with an option to manually trigger a mid-day load if up-to-the-minute data was needed for something.  If we go the Service Broker route, we can keep the Repository current in near real-time.  Hooray! DBA Mythbusters with Paul Randal (blog | Twitter).  Even though I read every one of the posts in Paul’s blog series of the same name, I had to go see the legend in person.  It was great, and I still learned something new! How to Conduct Effective Meetings with Joe Webb (blog | Twitter).  I always like to sit in on a session that Joe does.  I met Joe several years ago when both he and Bill Graziano were on the PASS Board of Directors together, and we have kept in touch.  Joe is very well-spoken and has great experience with both SQL Server and business.  And we could certainly use some pointers at my work (probably yours, too) on making our meetings more effective and to run on-time.  Of course, now that I’m the Chapter Leader for the Professional Development virtual chapter, I also had to sit in on this ProfDev session and recruit Joe to do a presentation or two for the chapter next year. Query Optimization with David DeWitt.  Anyone who has seen Dr. David DeWitt present the 3rd keynote at a PASS Summit over the last three years knows what a great time it is to sit and listen to him make some really complicated and advanced topic easy to understand (although it still makes your head hurt).  It still amazes me that the simple two-table join query from pubs that he used in his example can possibly have 22 million possible physical query plans.  Ouch! Exhibit Hall:  This year I spent more serious time in the exhibit hall than any year past.  I have talked my boss into making a significant (for us) investment in monitoring tools next year, and this was a great opportunity to talk with all the big-hitters.  Readers of mine may recall that I fell in love with the SQL Sentry Power Suite several months ago and wrote a blog entry about it just from the trial version.  Well as things turned out, short-term budget priorities shifted, and we weren’t able to make the purchase then.  I have it in the budget for next year, but since I was going to the Summit, my boss wanted me to look at the other options to see if this was really the one that we wanted.  I spent a couple of hours talking with representatives from Red-Gate, Idera, Confio, and Quest about their offerings, and giving them each the same 3 scenarios that I wanted to be able to accomplish based on the questions and issues that arise in our company.  It was interesting to discover the different approaches or “world view” that each vendor takes to the subject of performance monitoring and troubleshooting.  I may write a separate article that goes into this in more depth, but the product that best aligned with our point of view, and met the current needs we have is still the SQL Sentry Power Suite.  I’m not saying that the others are bad or wrong or anything like that, just that the way they tackled the issue did not align as well with our particular needs as does SQL Sentry’s product.  And that was something I learned too, when you go shopping for these products, you really need to know what you want to get from them.  It’s best if you have a few example scenarios from work that you can use to test out how well each tool fits your particular needs. Overall, another GREAT event.  I can’t wait to get the DVDs so I can sit in on a bunch of other sessions that I couldn’t get to because I was in one of the ones above.  And I can hardly wait until next year!

    Read the article

  • Is it Hard to Write a Blog?

    - by Joe Mayo
    Responding to a tweet I received, asking if I found it hard to write a blog and keep it interesting. This is one of the situations where a 140 character response doesn’t do a question justice. There’s a lot to think about between the subjects of writing, subject matter, and entertainment.  Here’s my take on each of these three topics: There’s all types of writing you can do with various degrees of difficulty. If you’re writing a book and you have a gazillion editors bleeding over your every utterance, then the task becomes harder because you’re second-guessing yourself, not knowing whose opinion will be violated. However, if you’re communicating in a public forum, not too many people care about the grammar as much as whether what you have to say is correct.  For a blog, I would say it’s somewhere in-between.  Right now, I’m using Windows Live Writer, which gives me a few advantages to just typing into the blog editor, such as spelling correction and the ability to save my work and resume later.  Overall, writing is one of those things that you just need to get used to.  It’s an essential skill for developers because you need to document your work, depending on what your definition of proper documentation is, and communicate with other developers via various communications mediums. Not begin good (or not thinking that you’re good) shouldn’t hold you back.  Like most things in life, practice will improve your skill.  So, push away that inner voice that keeps you from moving forward and just do it. A good grasp on the subject matter you’re writing about helps.  However, don’t let a lack of knowledge stop you from writing about something. I recall reading something a while back by a developer who didn’t know a technology but wrote about their experience in learning it. They ended up learning more by expressing their thoughts in writing. If you look around out many blogs today, there are many items written by developers learning what they’re writing about.  So, whether you are sure or unsure, you can still write – just be honest with yourself and your readers about what you’re writing. Also, don’t be afraid to have a different opinion or worry if someone will disagree.  I’ll freely admit that it took a while for me to become accustomed to being criticized. Take the good with the bad and use the bad to make yourself better. Guaranteed, someone will disagree with one or more parts of what I’ve written here or think they have a better approach. No problem, more power to them, and whatever constructive comments they have will be a benefit to me in the future; Otherwise, to h*ll with them. :)  Every time you get knocked down, get right back up, dust the dirt off your backside, and keep moving forward.  You’ll learn in time how to align a subject with your own presentation of the material. Entertainment could be hard or could be natural, depending on the personality of yourself and your target audience. It’s even more challenging because you can say something you think is funny and someone will be offended. In fact, there are a lot of things that you shouldn’t say in the name of a joke, but I won’t mention any of them here for want of not offending anyone. Of course, I probably offended someone by saying that and there is probably an organization somewhere in the world out to get me now. I’m probably not the best person to be giving you advice on entertaining an audience.  I mean, every time I try to tell a joke on Twitter 10 people unfriend me. Okay, maybe 15, but you get my point. One thing you might be interested in knowing is that it’s not too hard for one technical person to entertain other technical people, especially when the subject is of interest.  It’s the excitement in each sentence and passion in each paragraph that will keep another developer entertained and interested in what you have to say. Not everyone will like what you’ve written, but the important part is to find your own voice and it’s likely that there is one person in some corner of the world that likes what you have to say, even if it’s your mom and she doesn’t understand a single word you write. :)   If I could leave you with one final thought; Just do it and don’t let anyone or anything hold you back.   Joe

    Read the article

  • A Gentle Introduction to NuGet

    - by Joe Mayo
    Not too long ago, Microsoft released, NuGet, an automated package manager for Visual Studio.  NuGet makes it easy to download and install assemblies, and their references, into a Visual Studio project.  These assemblies, which I loosely refer to as packages, are often open source, and include projects such as LINQ to Twitter. In this post, I'll explain how to get started in using NuGet with your projects to include: installng NuGet, installing/uninstalling LINQ to Twitter via console command, and installing/uninstalling LINQ to Twitter via graphical reference menu. Installing NuGet The first step you'll need to take is to install NuGet.  Visit the NuGet site, at http://nuget.org/, click on the Install NuGet button, and download the NuGet.Tools.vsix installation file, shown below. Each browser is different (i.e. FireFox, Chrome, IE, etc), so you might see options to run right away, save to a location, or access to the file through the browser's download manager.  Regardless of how you receive the NuGet installer, execute the downloaded NuGet.Tools.vsix to install Nuget into visual Studio. The NuGet Footprint When you open visual Studio, observe that there is a new menu option on the Tools menu, titled Library Package Manager; This is where you use NuGet.  There are two menu options, from the Library Package Manager Menu that you can use: Package Manager Console and Package Manager Settings.  I won't discuss Package Manager Settings in this post, except to give you a general idea that, as one of a set of capabilities, it manages the path to the NuGet server, which is already set for you. Another menu, added by the NuGet installer, is Add Library Package Reference, found by opening the context menu for either a Solution Explorer project or a project's References folder or via the Project menu.  I'll discuss how to use this later in the post. The following discussion is concerned with the other menu option, Package Manager Console, which allows you to manage NuGet packages. Gettng a NuGet Package Selecting Tools -> Library Package Manager -> Package Manager Console opens the Package Manager Console.  As you can see, below, the Package Manager Console is text-based and you'll need to type in commands to work with packages. In this post, I'll explain how to use the Package Manager Console to install LINQ to Twitter, but there are many more commands, explained in the NuGet Package Manager Console Commands documentation.  To install LINQ to Twitter, open your current project where you want LINQ to Twitter installed, and type the following at the PM> prompt: Install-Package linqtotwitter If all works well, you'll receive a confirmation message, similar to the following, after a brief pause: Successfully installed 'linqtotwitter 2.0.20'. Successfully added 'linqtotwitter 2.0.20' to NuGetInstall. Also, observe that a reference to the LinqToTwitter.dll assembly was added to your current project. Uninstalling a NuGet Package I won't be so bold as to assume that you would only want to use LINQ to Twitter because there are other Twitter libraries available; I recommend Twitterizer if you don't care for LINQ to Twitter.  So, you might want to use the following command at the PM> prompt to remove LINQ to Twitter from your project: Uninstall-Package linqtotwitter After a brief pause, you'll see a confirmation message similar to the following: Successfully removed 'linqtotwitter 2.0.20' from NuGetInstall. Also, observe that the LinqToTwitter.dll assembly no longer appears in your project references list. Sometimes using the Package Manager Console is required for more sophisticated scenarios.  However, LINQ to Twitter doesn't have any dependencies and is a very simple install, so you can use another method of installing graphically, which I'll show you next. Graphical Installations As explained earlier, clicking Add Library Package Reference, from the context menu for either a Solution Explorer project or a project's References folder or via the Project menu opens the Add Library Package Reference window. This window will allow you to add a reference a NuGet package in your project. To the left of the window are a few accordian folders to help you find packages that are either on-line or already installed.  Just like the previous section, I'll assume you are installing LINQ to Twitter for the first time, so you would select the Online folder and click All.  After waiting for package descriptions to download, you'll notice that there are too many to scroll through in a short period of time, over 900 as I write this.  Therefore, use the search box located at the top right corner of the window and type LINQ to Twitter as I've done in the previous figure. You'll see LINQ to Twitter appear in the list. Click the Install button on the LINQ to Twitter entry. If the installation was successful, you'll see a message box display and disappear quickly (or maybe not if your machine is very fast or you blink at that moment). Then you'll see a reference to the LinqToTwitter.dll assembly in your project's references list. Note: While running this demo, I ran into an issue where VS had created a file lock on an installation folder without releasing it, causing an error with "packagename already exists. Skipping..." and then an error describing that it couldn't write to a destination folder.  I resolved the problem by closing and reopening VS. If you open the Add a Library Package Reference window again, you'll see LINQ to Twitter listed in the Recent packages folder. Summary You can install NuGet via the on-line home page with a click of a button.  Nuget provides two ways to work with packages, via console or graphical window.  While the graphical window is easiest, the console window is more powerful. You can now quickly add project references to many available packages via the NuGet service. Joe

    Read the article

  • JustCode Provides Reflector Alternative

    - by Joe Mayo
    If you've been a loyal Reflector user, you've probably been exposed to the debacle surrounding RedGate's decision to no longer offer a free version.  Since then, the race has begun for a replacement with a provider that would stand by their promises to the community.  Mono has an ongoing free alternative, which has been available for a long time.  However, other vendors are stepping up to the plate, with their own offerings. If Not Reflector, Then What? One of these vendors is Telerik.  In their recent Q1 2011 release of JustCode, Telerik offers a decompilation utility rivaling what we've become accustomed to in Reflector.  Not only does Telerik offer a usable replacement, but they've (in my opinion), produced a product that integrates more naturally with visual Studio than any other product ever has.  Telerik's decompilation process is so easy that the accompanying demo in this post is blindingly short (except for the presence of verbose narrative). If you want to follow along with this demo, you'll need to have Telerik JustCode installed.  If you don't have JustCode yet, you can buy it or download a trial at the Telerik Web site . A Tall Tale; Prove It! With JustCode, you can view code in the .NET Framework or any other 3rd party library (that isn't well obfuscated).  This demo depends on LINQ to Twitter, which you can download from CodePlex.com and create a reference or install the package online as described in my previous post on NuGet.  Regardless of the method, you'll have a project with a reference to LINQ to Twitter.  Use a Console Project if you want to follow along with this demo. Note:  If you've created a Console project, remember to ensure that the Target Framework is set to .NET Framework 4.  The default is .NET Framework 4 Client Profile, which doesn't work with LINQ to Twitter.  You can check by double-clicking the Properties folder on the project and inspecting the Target Framework setting. Next, you'll need to add some code to your program that you want to inspect. Here, I add code to instantiate a TwitterContext, which is like a LINQ to SQL DataContext, but works with Twitter: var l2tCtx = new TwitterContext(); If you're following along add the code above to the Main method, which will look similar to this: using LinqToTwitter; namespace NuGetInstall { class Program { static void Main(string[] args) { var l2tCtx = new TwitterContext(); } } } The code above doesn't really do anything, but it does give something that I can show and demonstrate how JustCode decompilation works. Once the code is in place, click on TwitterContext and press the F12 (Go to Definition) key.  As expected, Visual Studio opens a metadata file with prototypes for the TwitterContext class.  Here's the result: Opening a metadata file is the normal way that Visual Studio works when navigating to the definition of a type where you don't have the code.  The scenario with TwitterContext happens because you don't have the source code to the file.  Visual Studio has always done this and you can experiment by selecting any .NET type, i.e. a string type, and observing that Visual Studio opens a metadata file for the .NET String type. The point I'm making here is that JustCode works the way Visual Studio works and you'll see how this can make your job easier. In the previous figure, you only saw prototypes associated with the code. i.e. Notice that the default constructor is empty.  Again, this is normal because Visual Studio doesn't have the ability to decompile code.  However, that's the purpose of this post; showing you how JustCode fills that gap. To decompile code, right click on TwitterContext in the metadata file and select JustCode Navigate -> Decompile from the context menu.  The shortcut keys are Ctrl+1.  After a brief pause, accompanied by a progress window, you'll see the metadata expand into full decompiled code. Notice below how the default constructor now has code as opposed to the empty member prototype in the original metadata: And Why is This So Different? Again, the big deal is that Telerik JustCode decompilation works in harmony with the way that Visual Studio works.  The navigate to functionality already exists and you can use that, along with a simple context menu option (or shortcut key) to transform prototypes into decompiled code. Telerik is filling the the Reflector/Red Gate gap by providing a supported alternative to decompiling code.  Many people, including myself, used Reflector to decompile code when we were stuck with buggy libraries or insufficient documentation.  Now we have an alternative that's officially supported by a company with an excellent track record for customer (developer) service, Telerik.  Not only that, JustCode has several other IDE productivity tools that make the deal even sweeter. Joe

    Read the article

  • A Basic Thread

    - by Joe Mayo
    Most of the programs written are single-threaded, meaning that they run on the main execution thread. For various reasons such as performance, scalability, and/or responsiveness additional threads can be useful. .NET has extensive threading support, from the basic threads introduced in v1.0 to the Task Parallel Library (TPL) introduced in v4.0. To get started with threads, it's helpful to begin with the basics; starting a Thread. Why Do I Care? The scenario I'll use for needing to use a thread is writing to a file.  Sometimes, writing to a file takes a while and you don't want your user interface to lock up until the file write is done. In other words, you want the application to be responsive to the user. How Would I Go About It? The solution is to launch a new thread that performs the file write, allowing the main thread to return to the user right away.  Whenever the file writing thread completes, it will let the user know.  In the meantime, the user is free to interact with the program for other tasks. The following examples demonstrate how to do this. Show Me the Code? The code we'll use to work with threads is in the System.Threading namespace, so you'll need the following using directive at the top of the file: using System.Threading; When you run code on a thread, the code is specified via a method.  Here's the code that will execute on the thread: private static void WriteFile() { Thread.Sleep(1000); Console.WriteLine("File Written."); } The call to Thread.Sleep(1000) delays thread execution. The parameter is specified in milliseconds, and 1000 means that this will cause the program to sleep for approximately 1 second.  This method happens to be static, but that's just part of this example, which you'll see is launched from the static Main method.  A thread could be instance or static.  Notice that the method does not have parameters and does not have a return type. As you know, the way to refer to a method is via a delegate.  There is a delegate named ThreadStart in System.Threading that refers to a method without parameters or return type, shown below: ThreadStart fileWriterHandlerDelegate = new ThreadStart(WriteFile); I'll show you the whole program below, but the ThreadStart instance above goes in the Main method. The thread uses the ThreadStart instance, fileWriterHandlerDelegate, to specify the method to execute on the thread: Thread fileWriter = new Thread(fileWriterHandlerDelegate); As shown above, the argument type for the Thread constructor is the ThreadStart delegate type. The fileWriterHandlerDelegate argument is an instance of the ThreadStart delegate type. This creates an instance of a thread and what code will execute, but the new thread instance, fileWriter, isn't running yet. You have to explicitly start it, like this: fileWriter.Start(); Now, the code in the WriteFile method is executing on a separate thread. Meanwhile, the main thread that started the fileWriter thread continues on it's own.  You have two threads running at the same time. Okay, I'm Starting to Get Glassy Eyed. How Does it All Fit Together? The example below is the whole program, pulling all the previous bits together. It's followed by its output and an explanation. using System; using System.Threading; namespace BasicThread { class Program { static void Main() { ThreadStart fileWriterHandlerDelegate = new ThreadStart(WriteFile); Thread fileWriter = new Thread(fileWriterHandlerDelegate); Console.WriteLine("Starting FileWriter"); fileWriter.Start(); Console.WriteLine("Called FileWriter"); Console.ReadKey(); } private static void WriteFile() { Thread.Sleep(1000); Console.WriteLine("File Written"); } } } And here's the output: Starting FileWriter Called FileWriter File Written So, Why are the Printouts Backwards? The output above corresponds to Console.Writeline statements in the program, with the second and third seemingly reversed. In a single-threaded program, "File Written" would print before "Called FileWriter". However, this is a multi-threaded (2 or more threads) program.  In multi-threading, you can't make any assumptions about when a given thread will run.  In this case, I added the Sleep statement to the WriteFile method to greatly increase the chances that the message from the main thread will print first. Without the Thread.Sleep, you could run this on a system with multiple cores and/or multiple processors and potentially get different results each time. Interesting Tangent but What Should I Get Out of All This? Going back to the main point, launching the WriteFile method on a separate thread made the program more responsive.  The file writing logic ran for a while, but the main thread returned to the user, as demonstrated by the print out of "Called FileWriter".  When the file write finished, it let the user know via another print statement. This was a very efficient use of CPU resources that made for a more pleasant user experience. Joe

    Read the article

  • Windows Phone 8 Launch Event Summary

    - by Tim Murphy
    Today was the official coming out party for Windows Phone 8.  Below is a summary of the launch event.  There is a lot here to stay with me. They started with a commercial staring Joe Belfiore show how his Windows Phone 8 was personal too him which highlights something I think Microsoft has done well over the last couple of event: spotlight how Windows Phone is a different experience from other smartphones.  Joe actually called iPhone and Android “tired old metaphors" and explained that the idea around Windows Phone was to “reinvent the smartphone around you” as “the most personal smartphone operating system”.  The is the message that they need to drive home in their adds. The only real technical aspect we found out was that they have optimized the operating system around the dual core Qualcomm Snapdragon chip set.  It seems like all of the other hardware goodies had already been announced.  The remainder of the event was centered around new features of the OS and app announcements. So what are we getting?  The integrated features included lock screen live tile, Data Sense, Rooms and Kids corner.  There wasn’t a lot of information about it, but Joe also talked about apps not just having live tiles, but being live apps that could integrate with wallet and the hub. The lock screen will now be able to be personalized with live tile data or even a photo slide show.  This gives the lock screen an even better ability to give you the information you want to know before you even unlock the phone. The Kids Corner allows you as a parent to setup an area on your phone that you kids can go into an use it without disturbing your apps.  They can play games or use apps that you have designated and will only see those apps.  It even has a special lock screen gesture just for the kids corner. Rooms allow you to organize your phone around the groups of people in your life.  You get a shared calendar, a room wall as well as shared notes beyond just being able to send messages to a group.  You can also invite people not on the Windows Phone platform to access an online version of the room. Data Sense is a new feature that gives you better control and understanding of your data plan usage.  You can see which applications are using data and it can automatically adjust they way your phone behaves as you get close to your data limit. Add to these features the fact that the entire Windows ecosystem is integrated with SkyDrive and you have an available anywhere experience that is unequaled by any other platform.  Your document, photos and music are available on your Windows Phone, Window 8 device and Xbox.  SkyDrive also doesn’t limit how long you can keep files like the competing cloud platforms and give more free storage. It was interesting the way they made the launch event more personal.  First Joe brought out his own kids to demo the Kids Corner.  They followed this up by bringing out Jessica Alba to discuss her experience on the Windows Phone 8.  They need to keep putting a face on the product instead of just showing features as a cold list. Then we get to apps.  We knew that the new Skype was coming, but we found out that it was created in such a way that it can receive calls without running consistently in the background which would eat up battery.  This announcement was follow by the coming Facebook app that is optimized for Windows Phone 8.  As a matter of fact they indicated that just after launch the marketplace would have 46 out of the top 50 apps used by all smartphone platforms.  In a rational world this tide with over 120,000 apps currently in the marketplace there should be no more argument about the Windows Phone ecosystem. For those of us who develop for Windows Phone and weren’t on the early adoption program will finally get access to the SDK tomorrow after an announcement at Build (more waiting).  Perhaps we will get a few new features then. In the end I wouldn’t say there were any huge surprises, but I am really excited about getting my hands on the devices next month and starting to develop.  Stay tuned. del.icio.us Tags: Windows Phone,Windows Phone 8,Winodws Phone 8 Launch,Joe Belfiore,Jessica Alba

    Read the article

  • initWithCoder and initWithNibName

    - by vodkhang
    I am trying to encode some data state in a UITableViewController. In the first time, I init the object with Nibname without any problem. However, when I initWithCoder, the UITableViewController still loads but when I clicked on a cell, the application crash and the debugger tells me about EXEC_BAD_ACCESS, something wrong with my memory, but I do not know Here is my code: - (id) init { if(self = [self initWithNibName:@"DateTableViewController" bundle:nil]) { self.dataArray = [[NSMutableArray alloc] initWithObjects:@"1", @"2", @"3", nil]; } return self; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Set up the cell... int index = indexPath.row; cell.textLabel.text = [self.dataArray objectAtIndex:index];; return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return @"Test Archiver"; } - (void)encodeWithCoder:(NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.dataArray]; } - (id)initWithCoder:(NSCoder *)coder { return [self init]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int index = indexPath.row; [self.dataArray addObject:[NSString stringWithFormat:@"Hello %d", index]]; [self.tableView reloadData]; }

    Read the article

  • Restore and preserve UIViewController pushed from UINavigationController, no storyboard

    - by user2908112
    I try to restore a simple UIViewController that I pushed from my initial view controller. The first one is preserved, but the second one just disappear when relaunched. I don't use storyboard. I implement the protocol in every view controller and add the restorationIdentifier and restorationClass to each one of them. The second viewController inherit from a third viewController and is initialized from a xib file. I'm not sure if I need to implement the UIViewControllerRestoration to this third since I don't use it directly. My code looks like typically like this: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization self.restorationIdentifier = @"EditNotificationViewController"; self.restorationClass = [self class]; } return self; } -(void)encodeRestorableStateWithCoder:(NSCoder *)coder { } -(void)decodeRestorableStateWithCoder:(NSCoder *)coder { } +(UIViewController *)viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents coder:(NSCoder *)coder { EditNotificationViewController* envc = [[EditNotificationViewController alloc] initWithNibName:@"SearchFormViewController" bundle:nil]; return envc; } Should perhaps the navigationController be subclassed so it too can inherit from UIViewControllerRestoration?

    Read the article

  • Backbone.js "model" query

    - by Novice coder
    I'm a learning coder trying to understand this code from a sample MVC framework. The below code is from a "model" file. I've done research on Backbone.js, but I'm still confused as to exactly how this code pull information from the app's database. For example, how are base_url, Model.prototype, and Collection.prototype being used to retrieve information from the backend? Any help would be greatly appreciated. exports.definition = { config : { "defaults": { "title": "-", "description": "-" }, "adapter": { "type": "rest", "collection_name": "schools", "base_url" : "/schools/", } }, extendModel: function(Model) { _.extend(Model.prototype, { // Extend, override or implement Backbone.Model urlRoot: '/school/', name:'school', parse: function(response, options) { response.id = response._id; return response; }, }); return Model; }, extendCollection: function(Collection) { _.extend(Collection.prototype, { // Extend, override or implement Backbone.Collection urlRoot: '/schools/', name: 'schools', }); return Collection; } }

    Read the article

  • What does it mean when a User-Agent has another User-Agent inside it?

    - by Erx_VB.NExT.Coder
    Basically, sometimes the user-agent will have its normal user-agent displayed, then at the end it will have teh "User-Agent: " tag displayed, and right after it another user-agent is shown. Sometimes, the second user-agent is just appended to the first one without the "User-Agent: " tag. Here are some samples I've seen: The first few contain the "User-Agent: " tag in the middle somewhere, and I've changed its font to make it easier to to see. Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; MRA 5.10 (build 5339); User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 1.1.4322; .NET CLR 2.0.50727) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152) Here are some without the "User-Agent: " tag in the middle, but just two user agents that seem stiched together. Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); .NET CLR 3.5.30729) Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; IPMS/6568080A-04A5AD839A9; TCO_20090713170733; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1); InfoPath.2) Now, just to add a few notes to this. I understand that the "User-Agent: " tag is normally a header, and what follows a typical "User-Agent: " string sequence is the actual user agent that is sent to servers etc, but normally the "User-Agent: " string should not be part of the actual user agent, that is more like the pre-fix or a tag indicating that what follows will be the actual user agent. Additionally, I may have thought, hey, these are just two user agents pasted together, but on closer inspection, you realize that they are not. On all of these dual user agent listings, if you look at the opening bracket "(" just before the "compatible" keyword, you realize the pair to that bracket ")" is actually at the very end, the end of the second user agent. So, the first user agents closing bracket ")" never occurs before the second user agent begins, it's always right at the end, and therefore, the second user agent is more like one of the features of the first user agent, like: "Trident/4.0" or "GTB6" etc etc... The other thing to note that the second user agent is always MSIE 6.0 (Internet Explorer 6.0), interesting. What I had initially thought was it's some sort of Virtual Machine displaying the browser in use & the browser that is installed, but then I thought, what'd be the point in that? Finally, right now, I am thinking, it's probably soem sort of "Compatibility View" type thing, where even if MSIE 7.0 or 8.0 is installed, when my hypothetical the "Display In Internet Explorer 6.0" mode is turned on, the user agent changes to something like this. That being, IE 8.0 is installed, but is rendering everything as IE 6.0 would. Is there or was there such a feature in Internet Explorer? Am I on to something here? What are your thoughts on this? If you have any other ideas, please feel free to let us know. At the moment, I'm just trying to understand if these are valid User Agents, or if they are invalid. In a list of about 44,000 User Agents, I've seen this type of Dual User Agent about 400 times. I've closely inspected 40 of them, and every single one had MSIE 6.0 as the "second" user agent (and the first user agent a higher version of MSIE, such as 7 or 8). This was true for all except one, where both user agents were MSIE 8.0, here it is: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 8.0; Win32; GMX); GTB0.0) This occured once in my 40 "close" inspections. I've estimated the 400 in 44,000 by taking a sample of the first 4,400 user agents, and finding 40 of these in the MSIE/Windows user agents, and extrapolated that to estimate 40. There were also similar things occuring for non MSIE user agents where there were two Mozilla's in one user agent, the non MSIE ones would probably add another 30% on top of the ones I've noted. I can show you samples of them if anyone would like. There we have it, this is where I'm at, what do you guys think?

    Read the article

  • Writing/discussions about the aesthetics of code?

    - by dilettante.coder
    I'm looking for considerations of the questions "Can code be beautiful?" and "What makes code beautiful?" Examples would include: This academic paper: Obfuscation, Weird Languages, and Code Aesthetics This blog post: Hamon or the Skin Deep Beauty of Code Please note that I'm not trying to start a discussion here, or asking for opinions about what makes code beautiful, or for code you think is beautiful; I'm trying to find stuff that has already been published. Thanks for your help.

    Read the article

  • Which user account should be used for WSGIDaemonProcess?

    - by Nathan S
    I have some Django sites deployed using Apache2 and mod_wsgi. When configuring the WSGIDaemonProcess directive, most tutorials (including the official documentation) suggest running the WSGI process as the user in whose home directory the code resides. For example: WSGIScriptAlias / /home/joe/sites/example.com/mod_wsgi-handler.wsgi WSGIDaemonProcess example.com user=joe group=joe processes=2 threads=25 However, I wonder if it is really wise to run the wsgi daemon process as the same user (with its attendant privileges) which develops the code. Should I set up a service account whose only privilege is read-only access to the code in order to have better security? Or are my concerns overblown?

    Read the article

  • UppercuT &ndash; Custom Extensions Now With PowerShell and Ruby

    - by Robz / Fervent Coder
    Arguably, one of the most powerful features of UppercuT (UC) is the ability to extend any step of the build process with a pre, post, or replace hook. This customization is done in a separate location from the build so you can upgrade without wondering if you broke the build. There is a hook before each step of the build has run. There is a hook after. And back to power again, there is a replacement hook. If you don’t like what the step is doing and/or you want to replace it’s entire functionality, you just drop a custom replacement extension and UppercuT will perform the custom step instead. Up until recently all custom hooks had to be written in NAnt. Now they are a little sweeter because you no longer need to use NAnt to extend UC if you don’t want to. You can use PowerShell. Or Ruby.   Let that sink in for a moment. You don’t have to even need to interact with NAnt at all now. Extension Points On the wiki, all of the extension points are shown. The basic idea is that you would put whatever customization you are doing in a separate folder named build.custom. Each step Let’s take a look at all we can customize: The start point is default.build. It calls build.custom/default.pre.build if it exists, then it runs build/default.build (normal tasks) OR build.custom/default.replace.build if it exists, and finally build.custom/default.post.build if it exists. Every step below runs with the same extension points but changes on the file name it is looking for. NOTE: If you include default.replace.build, nothing else will run because everything is called from default.build.    * policyChecks.step    * versionBuilder.step NOTE: If you include build.custom/versionBuilder.replace.step, the items below will not run.      - svn.step, tfs.step, or git.step (the custom tasks for these need to go in build.custom/versioners)    * generateBuildInfo.step    * compile.step    * environmentBuilder.step    * analyze.step NOTE: If you include build.custom/analyze.replace.step, the items below will not run.      - test.step (the custom tasks for this need to go in build.custom/analyzers) NOTE: If you include build.custom/analyzers/test.replace.step, the items below will not run.        + mbunit2.step, gallio.step, or nunit.step (the custom tasks for these need to go in build.custom/analyzers)      - ncover.step (the custom tasks for this need to go in build.custom/analyzers)      - ndepend.step (the custom tasks for this need to go in build.custom/analyzers)      - moma.step (the custom tasks for this need to go in build.custom/analyzers)    * package.step NOTE: If you include build.custom/package.replace.step, the items below will not run.      - deploymentBuilder.step Customize UppercuT Builds With PowerShell UppercuT can now be extended with PowerShell (PS). To customize any extension point with PS, just add .ps1 to the end of the file name and write your custom tasks in PowerShell. If you are not signing your scripts you will need to change a setting in the UppercuT.config file. This does impose a security risk, because this allows PS to now run any PS script. This setting stays that way on ANY machine that runs the build until manually changed by someone. I’m not responsible if you mess up your machine or anyone else’s by doing this. You’ve been warned. Now that you are fully aware of any security holes you may open and are okay with that, let’s move on. Let’s create a file called default.replace.build.ps1 in the build.custom folder. Open that file in notepad and let’s add this to it: write-host "hello - I'm a custom task written in Powershell!" Now, let’s run build.bat. You could get some PSake action going here. I won’t dive into that in this post though. Customize UppercuT Builds With Ruby If you want to customize any extension point with Ruby, just add .rb to the end of the file name and write your custom tasks in Ruby.  Let’s write a custom ruby task for UC. If you were thinking it would be the same as the one we just wrote for PS, you’d be right! In the build.custom folder, lets create a file called default.replace.build.rb. Open that file in notepad and let’s put this in there: puts "I'm a custom ruby task!" Now, let’s run build.bat again. That’s chunky bacon. UppercuT and Albacore.NET Just for fun, I wanted to see if I could replace the compile.step with a Rake task. Not just any rake task, Albacore’s msbuild task. Albacore is a suite of rake tasks brought about by Derick Bailey to make building .NET with Rake easier. It has quite a bit of support with developers that are using Rake to build code. In my build.custom folder, I drop a compile.replace.step.rb. I also put in a separate file that will contain my Albacore rake task and I call that compile.rb. What are the contents of compile.replace.step.rb? rake = 'rake' arguments= '-f ' + Dir.pwd + '/../build.custom/compile.rb' #puts "Calling #{rake} " + arguments system("#{rake} " + arguments) Since the custom extensions call ruby, we have to shell back out and call rake. That’s what we are doing here. We also realize that ruby is called from the build folder, so we need to back out and dive into the build.custom folder to find the file that is technically next to us. What are the contents of compile.rb? require 'rubygems' require 'fileutils' require 'albacore' task :default => [:compile] puts "Using Ruby to compile UppercuT with Albacore Tasks" desc 'Compile the source' msbuild :compile do |msb| msb.properties = { :configuration => :Release, :outputpath => '../../build_output/UppercuT' } msb.targets [:clean, :build] msb.verbosity = "quiet" msb.path_to_command = 'c:/Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe' msb.solution = '../uppercut.sln' end We are using the msbuild task here. We change the output path to the build_output/UppercuT folder. The output path has “../../” because this is based on every project. We could grab the current directory and then point the task specifically to a folder if we have projects that are at different levels. We want the verbosity to be quiet so we set that as well. So what kind of output do you get for this? Let’s run build.bat custom_tasks_replace:      [echo] Running custom tasks instead of normal tasks if C:\code\uppercut\build\..\build.custom\compile.replace.step exists.      [exec] (in C:/code/uppercut/build)      [exec] Using Ruby to compile UppercuT with Albacore Tasks      [exec] Microsoft (R) Build Engine Version 3.5.30729.4926      [exec] [Microsoft .NET Framework, Version 2.0.50727.4927]      [exec] Copyright (C) Microsoft Corporation 2007. All rights reserved. If you think this is awesome, you’d be right!   With this knowledge you shall build.

    Read the article

  • Symbolic Regular Expression Exploration

    - by Robz / Fervent Coder
    This is a pretty sweet little tool. Rex (Regular Expression Exploration) is a tool that allows you to give it a regular expression and it returns matching strings. The example below creates10 strings that start and end with a number and have at least 2 characters: > rex.exe "^\d.*\d$" /k:10 This is something I could use to validate/generate the Regular Expressions I have created with both UppercuT and RoundhousE. Check out the video below: Margus Veanes - Rex - Symbolic Regular Expression Exploration Margus Veanes, a Researcher from the RiSE group at Microsoft Research, gives an overview of Rex, a tool that generates matching string from .NET regular expressions. Rex turns regular expres...

    Read the article

  • Chuck Norris Be Thy Name

    - by Robz / Fervent Coder
    Chuck Norris doesn’t program with a keyboard. He stares the computer down until it does what he wants. All things need a name. We’ve tossed around a bunch of names for the framework of tools we’ve been working on, but one we kept coming back to was Chuck Norris. Why did we choose Chuck Norris? Well Chuck Norris sort of chose us. Everything we talked about, the name kept drawing us closer to it. We couldn’t escape Chuck Norris, no matter how hard we tried. So we gave in. Chuck Norris can divide by zero. What is the Chuck Norris Framework? @drusellers and I have been working on a variety of tools: WarmuP - http://github.com/chucknorris/warmup (Template your entire project/solution and create projects ready to code - From Zero to a Solution with everything in seconds. Your templates, your choices.) UppercuT - http://projectuppercut.org (Build with Conventions - Professional Builds in Moments, Not Days!) | Code also at http://github.com/chucknorris/uppercut DropkicK - http://github.com/chucknorris/dropkick (Deploy Fluently) RoundhousE - http://projectroundhouse.org (Professional Database Management with Versioning) | Code also at http://github.com/chucknorris/roundhouse SidePOP - http://sidepop.googlecode.com (Does your application need to check email?) HeadlocK - http://github.com/chucknorris/headlock (Hash a directory so you can later know if anything has changed) Others – still in concept or vaporware People ask why we choose such violent names for each tool of our framework? At first it was about whipping your code into shape, but after awhile the naming became, “How can we relate this to Chuck Norris?” People also ask why we uppercase the last letter of each name. Well, that’s more about making you ask questions…but there are a few reasons for it. Project managers never ask Chuck Norris for estimations…ever. The class object inherits from Chuck Norris Chuck Norris doesn’t need garbage collection because he doesn’t call .Dispose(), he calls .DropKick() So what are you waiting for? Join the Google group today, download and play with the tools. And lastly, welcome to Chuck Norris. Or should I say Chuck Norris welcomes you…

    Read the article

  • Professional iOS Development as a Backup Career [closed]

    - by New Coder
    I am a research chemist by day and I am a self-taught hobbyist iOS programmer by night. I am in the process of developing a moderately complex iOS app and hope to launch it within a month or two. I love everything about iOS development (and programming in general). I want to know if iOS development could become a backup career for me if I loose my job. My question: Let's say I had a couple of apps in the app store, a solid foundation in objective-C and the apple frameworks and basic knowledge on network integrated apps. Without a formal CS degree, what other experience/knowledge would I need to land a job as a professional iOS developer? Forgive me if this question is out of bounds for this forum. If it is, suggestions on where to post such a question would be appreciated.

    Read the article

  • Coders For Charities

    - by Robz / Fervent Coder
    Last weekend I had the opportunity to give back to the community doing what I love. As geeks we don’t usually have this opportunity. The event is called Coders 4 Charities (C4C) and it’s a grueling weekend of coding for nearly 30 hours over the weekend. When you finish you get to present to the charity and all of the other groups what you have completed. From the site: Coders For Charities is a 3-day charity event that pairs charities and local software developers. Charities often do not have the funds to implement a new website or intranet or database solution. Software developers often do not volunteer for charities because their skills do not apply. This event is the perfect marriage of these two needs; software developers volunteering their time to help charities better serve their community though the latest technology! The actual event was lined with multiple charities and about 50 developers, designers, business analysts, etc, each working with a different charity to come up with a solution that they could implement in less than 3 days. C4C provided a place and food for us so that we wouldn’t have to leave much during the time we had to implement our solution. They also provided games like Rock Band so we could get away and clear our minds for a few moments if necessary. I don’t think we made it down there to play, but the food and drinks were a huge help for us. The charity we we picked was Harvest Home. They had a need for an online intranet site where they could track membership and gardening. Over the next few days we worked on a site we could give them. Below is a screen shot with private data marked out. It was an awesome and humbling experience to be able to give back to a charity and I’m happy I was a part of it. I would definitely do it again. How often do we get to use our abilities to volunteer our time to a charity?

    Read the article

  • Puppet: Making Windows Awesome Since 2011

    - by Robz / Fervent Coder
    Originally posted on: http://geekswithblogs.net/robz/archive/2014/08/07/puppet-making-windows-awesome-since-2011.aspxPuppet was one of the first configuration management (CM) tools to support Windows, way back in 2011. It has the heaviest investment on Windows infrastructure with 1/3 of the platform client development staff being Windows folks.  It appears that Microsoft believed an end state configuration tool like Puppet was the way forward, so much so that they cloned Puppet’s DSL (domain-specific language) in many ways and are calling it PowerShell DSC. Puppet Labs is pushing the envelope on Windows. Here are several things to note: Puppet x64 Ruby support for Windows coming in v3.7.0. An awesome ACL module (with order, SIDs and very granular control of permissions it is best of any CM). A wealth of modules that work with Windows on the Forge (and more on GitHub). Documentation solely for Windows folks - https://docs.puppetlabs.com/windows. Some of the common learning points with Puppet on Windows user are noted in this recent blog post. Microsoft OpenTech supports Puppet. Azure has the ability to deploy a Puppet Master (http://puppetlabs.com/solutions/microsoft). At Microsoft //Build 2014 in the Day 2 Keynote Puppet Labs CEO Luke Kanies co-presented with Mark Russonivich (http://channel9.msdn.com/Events/Build/2014/KEY02  fast forward to 19:30)! Puppet has a Visual Studio Plugin! It can be overwhelming learning a new tool like Puppet at first, but Puppet Labs has some resources to help you on that path. Take a look at the Learning VM, which has a quest-based learning tool. For real-time questions, feel free to drop onto #puppet on freenode.net (yes, some folks still use IRC) with questions, and #puppet-dev with thoughts/feedback on the language itself. You can subscribe to puppet-users / puppet-dev mailing lists. There is also ask.puppetlabs.com for questions and Server Fault if you want to go to a Stack Exchange site. There are books written on learning Puppet. There are even Puppet User Groups (PUGs) and other community resources! Puppet does take some time to learn, but with anything you need to learn, you need to weigh the benefits versus the ramp up time. I learned NHibernate once, it had a very high ramp time back then but was the only game on the street. Puppet’s ramp up time is considerably less than that. The advantage is that you are learning a DSL, and it can apply to multiple platforms (Linux, Windows, OS X, etc.) with the same Puppet resource constructs. As you learn Puppet you may wonder why it has a DSL instead of just leveraging the language of Ruby (or maybe this is one of those things that keeps you up wondering at night). I like the DSL over a small layer on top of Ruby. It allows the Puppet language to be portable and go more places. It makes you think about the end state of what you want to achieve in a declarative sense instead of in an imperative sense. You may also find that right now Puppet doesn’t run manifests (scripts) in order of the way resources are specified. This is the number one learning point for most folks. As a long time consternation of some folks about Puppet, manifest ordering was not possible in the past. In fact it might be why some other CMs exist! As of 3.3.0, Puppet can do manifest ordering, and it will be the default in Puppet 4. http://puppetlabs.com/blog/introducing-manifest-ordered-resources You may have caught earlier that I mentioned PowerShell DSC. But what about DSC? Shouldn’t that be what Windows users want to choose? Other CMs are integrating with DSC, will Puppet follow suit and integrate with DSC? The biggest concern that I have with DSC is it’s lack of visibility in fine-grained reporting of changes (which Puppet has). The other is that it is a very young Microsoft product (pre version 3, you know what they say :) ). I tried getting it working in December and ran into some issues. I’m hoping that newer releases are there that actually work, it does have some promising capabilities, it just doesn’t quite come up to the standard of something that should be used in production. In contrast Puppet is almost a ten year old language with an active community! It’s very stable, and when trusting your business to configuration management, you want something that has been around awhile and has been proven. Give DSC another couple of releases and you might see more folks integrating with it. That said there may be a future with DSC integration. Portability and fine-grained reporting of configuration changes are reasons to take a closer look at Puppet on Windows. Yes, Puppet on Windows is here to stay and it’s continually getting better folks.

    Read the article

  • Ajax application: using SOAP vs REST ?

    - by coder
    I'm building an ajax heavy application (client-side strictly html/css/js) which will be getting all the data and using server business logic via webservices. I know REST seems to be the hot topic but I can't find any good arguments. The main argument seems to be its "light-weight". My impression so far is that wsdl/soap based services are more expressive and allow for more a more complex transfer of data. It appears that soap would be more useful in the application I'm building where the only code consuming the services will be the js downloaded in the client browser. REST on the other hand seems to have a smaller entry barrier and so can be more useful for services like twitter in allowing other developers to consume these services easily. Also, REST seems to Te better suited for simple data transfers. So in summary SOAP is useful for complex data transfer and REST is useful in simple data transfer. I'm currently under the impression that using SOAP would be best due to the complexity of the messages but perhaps there's other factors. What are your thoughts on the pros/cons of soap/rest for a heavy ajax web app? EDIT: While the wsdl is in xml, the data I'm transferring back and forth is actually in JSON. It just appears more natural to use wsdl/soap here due to the nature of the app. The verbs GET and POST may not be enough. I may want to say something like: processQueue, or executeTimer. This is why my conclusion has been wsdl/soap would be good for bridging a complex layer between two applications (client and server) whereas REST would be better (due to its simplicity) for allowing many developer-users to consume resources programmatically. So you could say the choice falls along two lines Will the app be verb-oriented (completing tasks: use soap) or noun-oriented (consuming resources: use REST) Will the api be consumed by few developers or many developers (REST is strong for many developers)? Since such an ajax heavy app would potentially use many verbs and would only be used by the client developer it appears soap/wsdl would be the best fit.

    Read the article

  • Snow Leopard .htaccess issue

    - by Joe.Cianflone
    Hello, I'm running into an issue on Snow Leopard. I am just using the standard Apache2 that came with it but it doesn't seem to want to use my .htaccess file. Here is the appropriate part of my httpd.conf file: <Directory /> Options FollowSymLinks AllowOverride All AuthConfig Order deny,allow Deny from all </Directory> And here is my .htaccess file: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] I'm sure I'm doing something stupid, but at this point, I just cant see it! All it's doing is allowing me to not have the index.php file, this worked on Leopard and isn't working in Snow Leopard. What am I missing? Thanks Joe C

    Read the article

  • Microsoft C# Most Valuable Professional

    - by Robz / Fervent Coder
    Recently I was awarded the Microsoft Most Valuable Professional (MVP) for Visual C#. For those that don’t know it’s an annual award based on nominations from peers and Microsoft. Although there are just over 4,000 MVPs worldwide from all kinds of specializations, there are less than 100 C# MVPs in the US. There is more information at the site: https://mvp.support.microsoft.com The Microsoft MVP Award is an annual award that recognizes exceptional technology community leaders worldwide who actively share their high quality, real world expertise with users and Microsoft. With fewer than 5,000 awardees worldwide, Microsoft MVPs represent a highly select group of experts. MVPs share a deep commitment to community and a willingness to help others. To recognize the contributions they make, MVPs from around the world have the opportunity to meet Microsoft executives, network with peers, and position themselves as technical community leaders. Here is my profile: https://mvp.support.microsoft.com/default.aspx/profile/rob.reynolds I want to thank those that nominated me, without nominations this would never have happened. Thanks to Microsoft for liking me and finding my achievements and contributions to the community to be worth something. It’s good to know when you put in a lot of hard work that you get rewarded! I also want to thank many of the people I have worked with over the last 7 years. You guys have been great and I’m definitely standing on the shoulders of giants! Thanks to KDOT for giving me that first shot into professional programming and the experience and all of the training! A special thanks to @drusellers for kick starting me when I went stale in my learning back in 2007 and for always pushing me and bouncing ideas off of me. Without you I don’t think I would have made it this far. Thanks Alt.NET for keeping it fresh and funky! A very special thank you goes out to my wife for supporting me and locking me in the basement to work on all of my initiatives!

    Read the article

  • What do these "Cron Daemon" email errors mean?

    - by Meltemi
    Anyone know what this means? Getting one of these every minute in one user's inbox: From: Cron Daemon <[email protected]> Subject: Cron <joe@mail> /tmp/.d/update >/dev/null 2>&1 To: [email protected] Received: from murder ([unix socket]) by mail.domain.com (Cyrus v2.2.12-OS X 10.3) with LMTPA; Tue, 04 May 2010 10:35:00 -0700 shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied job-working-directory: could not get current directory: getcwd: cannot access parent directories: Permission denied

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >