codes

Criticising code

What is the best way to point out flaws in a developers code? Stuff they've been working on a while and though you'd love to not say anything, it's bad code and something has to be said. How do you go about it without them getting angry at you?...

HTTP: How to know when to send a 304 Not Modified response

I'm writing a resource handling method where I control access to various files, and I'd like to be able to make use of the browser's cache. My question is two-fold: Which are the definitive HTTP headers that I need to check in order to know for sure whether I should send a 304 response, and what am I looking for when I do check them? ...

What is some great source code to read?

Following the advice of Scott Hanselman, I'm looking for good source code to read. Here's what is currently on my list: Scott's posts CodeProject How about you? What source code do you read? It doesn't have to be .NET related. Update Compiled replies: Beautiful Code Donald Knuth's literate programs CodePlex Linux SQLite Java J...

Code Gen options, what do you use for your apps and why?

Hi, So far the most I've done with code generation tools is creating my basic CRUD layers (basic sprocs, data layer and business layer that calls the data layer), and class creation based on my database tables. What other ways do people use code gen tools? I've never used ORM mappers or Hibernate and quite frankly don't understand wha...

Can you recommend a good free code generator?

I've heard about the Codesmith and Resharper and I think they're good but not free, can you recommend the free alternatives? ...

Fastest C# Code to Download a Web Page

Given a URL, what would be the most efficient code to download the contents of that web page? I am only considering the HTML, not associated images, JS and CSS. ...

Favorite IDE feature?

What is your favorite feature of your IDE/code editor? What makes you like it so much? Is there a feature that it doesn't have that would be a strong enough pull to cause you to switch IDE's (code editors)? ...

Is there an automatic code formatter for C#?

In my work I deal mostly with C# code nowadays, with a sprinkle of java from time to time. What I absolutely love about Eclipse (and I know people using it daily love it even more) is a sophisticated code formatter, able to mould code into any coding standard one might imagine. Is there such a tool for C#? Visual Studio code formatting (...

How can I generate a unique, small, random, and user-friendly key?

A few months back I was tasked with implementing a unique and random code for our web application. The code would have to be user friendly and as small as possible, but still be essentially random (so users couldn't easily predict the next code in the sequence). It ended up generating values that looked something like this: Af3nT5Xf2 ...

Are there any tools to visualize template/class methods and their usage?

I have taken over a large code base and would like to get an overview how and where certain classes and their methods are used. Is there any good tool that can somehow visualize the dependencies and draw a nice call tree or something similar? The code is in C++ in Visual Studio if that helps narrow down any selection. ...

How can I display Word documents in a textarea using PHP?

I was trying to test code using com class to display Word files but I cannot seem to get the answer and still searching. I get errors and sometimes, programs do not display anything at all. Please give me some ideas. I'm working with PHP 4. ...

How do we perform multi threading application in C#?

Duplicate of c# threading Beginners threading in C# Multithreading reference? Can any body provide some good examples, codes for multi threading in c#.. I tried on google but I need examples with good explanation about what is happening at what point? ...

Can you recommend any information about least ambiguous letters/numbers?

I'm interested in generating short codes (up to 6 characters) which are unambiguous for human readability: i.e.: 2Z8B5S would be a very bad code because B looks a lot like 8 and 2 looks a lot like Z, etc. A good code would be something like: AE37HT, say. Obviously, I could try to figure it out myself, but I was looking to see if there...

Using a code for an exception. Useful?

Hi, I am not sure if Exceptions work the same way in each language, but I am using PHP and I was wondering when I'm doing something like this: if (!$this->connection[0]->query($this->query)) throw new QueryFailedException($this->connection[0]->error); Is there a need to supply a code in the second parameter? For example: if (!$this...

Test For Password Protected Folder

How do I use PHP to check whether a folder is password protected or not? I am using a PHP script that check for return codes 401 and 403 but when it runs into a folder that is password protected it recognizes that its a 403 but does not allow the popup box for username and password to display? How do I detect that the folder is password ...

Crystal Report with embedded codes (in a native printer font - Courier) to a RightFax printer (server) is not working

We are using Visual Studio 2005 and 2008, sending a Crystal Report with embedded codes (in a native printer font - Courier) to a RightFax printer (server). Visual Studio 2003 works; this process stopped working (the embedded codes aren't recognized) when we upgraded to Visual Studio 2005, and then 2008. With Visual Studio 2003, we use ...

What is a good service that offers registration code and activation services for Cocoa/OSX applications?

I have a completed Cocoa application and would like to sell it. I have found many services that will sell your application, but not many that will also handle activation. Are there any services that will integrate activation into the installation file or are there any services that are easy to integrate (hopefully will take at max an hou...

how do I give out free review copies of my paid android app?

With the iPhone, Apple has a system of free codes you can send to reviewers so they can install the app for free. Is there a way to do this with paid Android apps? ...

How do I save statuses as codes in db but map them to meaningful words in rails?

I need some help with this, please ... If I save a transaction status as a code in the db, but I want to translate them to meaningful names how do I do that? Is that even recommended? If no, what would be an alternative to that? For example: in the db the statuses are "S", "P", "A" and in the actual application I'd like to display: "Su...

C# How can I get a list of country codes?

I need to know how can I get the list of country codes for mobile purposes, for eg, I am living in Singapore and my country code is (65). If I want to send a sms or call a number, I will specify +65 98287222. Edited: Is there any codes available to populate this list of country calling codes? I am using C#, windows application. Help ...