Unless a class specifically overrides the behavior defined for Object, ReferenceEquals and == do the same thing... compare references.
In property setters, I have commonly used the pattern
private MyType myProperty;
public MyType MyProperty
{
set
{
if (myProperty != value)
{
myProperty = value;
//…
I don't really see the point of making methods or classes internal. In my very limited understanding, all it does is make working with your code very difficult for other programmers. Say I write Big_Important_Class for Project A and make said class internal. Then Bob, working on Project B needs to use my class to have project B work with…
Hi guys,
I'm building a dummy widget for a iGoogle/Netvibes like portal. This is a "Google Maps" widget, as it only renders a map centered on a specific location.
The widget looks good in all browsers but IE8, in which the height I specify to the <div> that contains the map is not taken into account.
Here's the interesting part of…
hey
guys i need to count new private messages and old one from a table
so first thing come to mind is using mysql_num_rows and easy thing to do
// check new pms
$user_id = $userinfo['user_id'];
$sql = "SELECT author_id FROM bb3privmsgs_to WHERE user_id='$user_id' AND (pm_new='1' OR pm_unread='1')";
$result =…
I'm writing bash script, which does several thing.
In the beginning it starts several monitor scripts, each of them runs some other tools.
At the end of my main script, I would like to kill all things that spawned from my shell.
So, it might looks like this:
#!/bin/bash
some_monitor1.sh &
some_monitor2.sh &…
This summer I'm getting into UNIX (mostly *BSD) development. I've graduate level knowledge about operating systems. I can also understand the code & read from here and there but thething is I want to make most of my time. Reading books are best for this.
From my search I found that these two books
The Design…
I tried to assign a class static variable like this
class QueryLogger < Logger
@@query_logger_default_instance = nil
def self.default_instance
# Use global variable because static variable doesn't work
@@query_logger_default_instance ||= self.new(STDOUT)
end
end
In initializers folder of my rails…
hopefully there's an easy solution to this one.
I have my MVC2 project which allows uploads of files on certain forms. I'm trying to keep my controllers lean, and handle the processing within the business layer of this sort of thing.
That said, HttpFileCollectionBase is obviously in the System.Web assembly.
…
Hi Stackers!
I wrote iPhone application. Very simple! It use Cocos2D only, and all other features is very basic, no accelerometer, no camera, nothing. Just buttons and sounds.
I think every iPhone can run this app (there is no limits on Cocos2D right?), but my XCode only let me use 3.0 and upwards. I want to…
I'm writing a web app, initially meant to be stand-alone--it's essentially a survey with user-management/authentication built on Codeigniter. The company I'm doing this for wants to merge it with their main system so that it acts like a feature, or a sub-app of their website.
What is the best thing for me to…
Can someone explain a "tracking branch" as it applies to git?
Here's the definition from git-scm.com:
A 'tracking branch' in Git is a local
branch that is connected to a remote
branch. When you push and pull on that
branch, it automatically pushes and
pulls to the remote branch that it is
…
I really enjoy software development. I've done it for going on 3 years now full-time for a small company and still find it interesting and exciting. I haven't had much server/network experience but have an opportunity to work for a large IT company dealing with server setups, configurations, maintenance…
(HOBBY) I own a Macbook Pro and iPod Touch so developing iPhone/iPod/iPad apps seems like a logical thing to do in order to get some experience in the programming field. Besides I want to write a new application similar to the Capsuleer (Character skills monitor app for EVE Online MMO) but with more…
Hi guys, I'm here to ask you the difference between a process and a thread in linux. I know that a thread for linux is just a "task", which shares with the father process things that they need to have in common (the address space and other important informations). I also know that the two are…
When I press F5 the project compiles, and the new web page launches. However, the silverlight control loads (the standard load counter counts to 100%) but then the whole control just disappear. Only the left default menu bar (feedback etc) is visible. It's a very small project, my first…
Hey,
In a MonoRail app I have an add/edit view. On add if I don't pick a value for a dropdown I get a validation error and am forced to pick a value. However, if I then edit that same item and reset the dropdown back to the first item ("Select an Item", "0"), it saves and doesn't say…
How do you deal with analysis and design phases when you plan to develop a system using a functional programming language like Haskell?
My background is in imperative/object-oriented programming languages, and therefore, I am used to use case analysis and the use of UML to document…
I have the following NinjectModule, where we bind our repositories and business objects:
/// <summary>
/// Used by Ninject to bind interface contracts to concrete types.
/// </summary>
public class ServiceModule : NinjectModule
{
/// <summary>
/// Loads…
Hi Guys
I was a bit surprised a few minutes ago when I tried to overload an Action in one of my Controllers
I had
public ActionResult Get()
{
return PartialView(/*return all things*/);
}
I added
public ActionResult Get(int id)
{
return PartialView(/*return 1…
Dear all,
I have a file name abc.txt.On that file have some lines like this:
jani
50,south carolina,USA
karim
16,roam,Italy
fara
52,sydny,Australia
first line is name and second line is address.Now i need the info name on a string let say nameString and address is let…
I have an aspx page that uses master page. In the papx page, I load a user control containing 2 RadUpload controls (Rad1 and Rad2). User can choose to upload the file either using the first RadUpload or the second RadUpload and there is certain validation applied for each…
I have a resource that looks something like this:
/users/{id}/summary?format={format}
When format is "xml" or "json" I respond with a user summary object that gets automagically encoded by WCF - fine so far. But when format equals "pdf", I want my response to consist…
I've got a bunch of tests in NUnit which create garbage data on the filesystem (bad, I know, but I have little control over this). Currently we have a cleanup tool that removes these temporaries and such, but I'd like to be able to run that cleanup tool automatically.…
A configuration management pattern question (using Rational ClearCase UCM)
When I use the mainline approach I create new releases by:
- create release 1 from mainline
- on a certain moment baseline release 1, deliver release 1 to mainline
- create release 2 from…