examples

Real world examples of @optional protocol methods

I'm learning Objective-C at the moment and have come across optional methods in Protocols. My background is C# and can see a Protocol as something similar to a C# Interface. Where a C# Interface represents a contract, by advertising an Interface you are saying that you will implement the methods defined. With this in mind I'm confused ...

sites using java 3d ? ( need to develop 3d for the web )

Hello all do you know good example of sites that using java 3d for there content ? i need to fine some kind of 3d solution , and now only java 3d solution is the best as i see it . but i didn't found any good site examples ...

Which should inherit which?

This is one of the boring academic OOP questions, but it is not a homework. I got the question from a newbie programmer about one of those stupid textbooks examples about OOP. Imagine that you are designing a Square class and a Cube class, which should inherit which? I see a relationship, but what it is, I can not really see! Could yo...

Open source examples of well written SCM web interface in Perl

Can anyone point me to some good Open Source web interface for VCS (version control system) written in Perl? Something well written, so I can examine the code and steal the best parts (or organization) for gitweb. Preferably something without tons of external dependences not available in (extended) Perl core. ...

Well written Open Source Cocoa Apps to learn from

Hey, I'm learning Cocoa and while I get comfortable with Objective-C and the concepts around it, I sometimes struggle applying the theory (like MVC) in praxis. Apple's documentation often gives me aha moments, but it would be cool to have a well written Cocoa App as a reference. So, do you know a very well written Cocoa App with public...

Class diagram examples for RPG (Role Playing Game)

Does anyone know where I can find examples of class diagrams for RP game development? Something similar to here would be quite useful. I'm not looking for things I can slavishly copy, but just for different examples that diagram various solutions to the problems I'm discovering as I try and pencil down my own classes. ...

Is there a C++ Almanac ?

Hi ... some of you may know the Java Almanac : http://www.exampledepot.com/ where a lot of code snippets exist for a day-to-day use.(like reading a file etc.) I'm currently using C++ and i was just curios if there exists something similar ? ...

Why are all the tk examples in a Python distribution written in TCL?

Now don't get me wrong, I'm not exactly a Python fan, but when you see a Tk directory inside of the python directory you kinda expect... Well Python. And yeah, I get that Tk came from TCL, but if I had to write a TCL to use Tk, I'd forget TK existed and use a completely different tool box. (The popularity of this combination completely ...

Impressive examples in Java?

I'm going to teach a Java course, and I want to show some interesting and impressive examples of simple Java programs at the first lecture to awaken student interest. Except for the default examples which come with the JDK, what can you advise? What possibilities of Java were you impressed by? One more thing - students admittedly kno...

Where to get well designed and coded applications written in C# to learn from them?

I got into log4net code and Nunit. Both of them gave me something to think about and taught me something new. What other aps do you know, with source code open that worth reading their code? Also, what is the best way to get into the code, sure if you cant ask its creator a question? A little addition, I`d like to have sources read by y...

What kind of category methods do you use to make Cocoa programming easier?

I use a collection of category methods for Cocoa's built in classes to make my life easier. I'll post some examples, but I really want to see what other coders have come up with. What kind of handy category methods are you using? Example #1: @implementation NSColor (MyCategories) + (NSColor *)colorWithCode:(long)code { return [NSCo...

C# Structs - real life examples?

There are any number of questions here on SO dealing with the differences between Structs and Classes in C#, and when to use one or the other. (The one sentence answer: use structs if you need value semantics.) There are plenty of guidelines out there about how to choose one or the other, most of which boil down to: use a class unless ...

What are some common SQL injection checks I can use?

I'm running through my web app and I'm trying to test various parts of the system to make sure they aren't succeptible to SQL injection. What are some common sql injection checks I can perform on textboxes/textareas, etc that would be good checks for vulnerability? I'm not worried about damaging my data as I'm running this on a test be...

Is there a good iphone sdk documentation site that provides good examples / common usage?

The problem? I look up stuff in the xcode documentation and find very useful lists of objects, methods, etc... But then I still have to go somewhere else to find useful example code of how to use that object. For example, I looked up NSNumber yesterday and found all of the neat stuff it can do, but I still had no clue how to use it. ...

DotNET String comparisons

After a few harsh lessons I now always use OrdinalIgnoreCase when comparing Strings in DotNET. I've run into maybe 5 different problems to do with numerics, weird alphabets and localisations. Does anyone know of a good site that explains in depth a lot of the problems with culture specific Strings, preferably with a bunch of good example...

What are some of the more practical uses you've applied for jQuery's data() method?

As the question pretty much sums up, I'm doing a presentation on some of the more "hidden" aspects of jQuery, including the data() function. I'm quite comfortable with how the function works, but am struggling to come up with enough actual usage examples outside of basic setting / getting and identifying the events bound to an element. ...

Best place to get PHP generic code examples

Aside from the PEAR repository, which I find often has quite messy code with a lot of it using old or deprecated methods and techniques, I was wondering if there was a great place to find simple (and not so simple) PHP examples of some generic functions and good pieces that people have written. A good example would be the PEAR spreadsh...

Exemplary server side code

Hi It's all well and good talking about best practices and so on, but if you're anything like me there is so much to be learned from looking at great code. I regularly examine HMTL, CSS, Javascript using firebug, or when coding in C++ I can call upon any of the vast number of high quality open source projects, like boost. However, I d...

How do I load example datasets in R?

Let's say I want to reproduce an example posted on StackOverflow. Some have suggested posters use dput() to help streamline this process or one of the datasets available in the base package. In this case, however, suppose I have only been given the output of the dataframe: > site.data site year peak 1 ALBEN 5 101529.6 2 ...

What does "not run" mean in R help pages?

Sometimes on an R help page the phrase "not run" appears in comments. Check out this from the help page for "with()": Examples require(stats); require(graphics) #examples from glm: **## Not run:** library(MASS) with(anorexia, { anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt), family = gaussian) summar...