13February2008
Posted by Mikhail Esteves under: General.
We all know that people don’t like filling out forms online, including the folks who design and build them. Most good web designers working today know to keep them as concise and painless as possible. A minimalist sign up process on your shiny new web app is sure to produce a higher sign up rate than one that asks for a dozen pieces of irrelevant information.
Sometimes, however, you’ll want to develop a form that truly benefits from a large number of options. Let’s design a search form for a fictional used automobile site. Presenting every option in your database would probably be messy and intimidating. Just one section might look something like this
Read more
27January2008
Posted by Mikhail Esteves under: LAMP; Tips.
If you want to delete rows older than xx dates using MySQL, here is a simple way of doing so:
DELETE FROM mytable WHERE date < DATE_SUB(NOW(), INTERVAL 30 DAY);
You could also use INTERVAL 1 MONTH.
17January2008
Posted by Mikhail Esteves under: C#; Tips.
Want to have values for each ComboBox item in WinForms? Here is a simple way of doing so. Add a class in your project named ComboBoxItem:
public class ComboBoxItem
{
private string _value;
private string _text;
public string Value { get { return _value; } }
public string Text { get { return _text ; } }
public ComboBoxItem (string cValue, cText)
{
this._value = cValue;
this._text = cText;
}
}
Now when adding items to the ComboBox, you would do this:
ComboBox myBox = new ComboBox ();
myBox.Items.Add (new ComboBoxItem ("1", "January"));
myBox.Items.Add (new ComboBoxItem ("2", "February"));
myBox.DisplayMember = "Text"; // Specifies what to display
this.Controls.Add (myBox);
To retrieve the current selected value and text, you could do:
string SelectedItemValue = (myBox.SelectedItem as ComboBoxItem).Value;
string SelectedItemText = (myBox.SelectedItem as ComboBoxItem).Text;
8January2008
Posted by Mikhail Esteves under: C#; Tips.
The Math.Round function in .NET uses the bankers method instead of the mathematical method. So with this new stroke of brilliance, Math.Round(5.5) would give you 5 and Math.Round(5.50001) would give you 6.
Here is a function to do it the traditional way (from here):
public static double RoundNumber(double num, int place)
{
double n;
n = num * Math.Pow(10, place);
n = Math.Sign(n) * Math.Abs(Math.Floor(n + .5));
return n / Math.Pow(10, place);
}
27December2007
Posted by Mikhail Esteves under: Random Websites.
“kwout” is a way you quote a part of a web page as an image with an image map.
To use this service, all you need is to add our bookmarklet to your favorite browser.
Link
26December2007
Posted by Mikhail Esteves under: Links.
But with the power of Google Chart API in your hands all you need to know is to insert an image in your web page and watch your chart come to life. But if you are thinking that what could be the use of using a static image for showing a chart then you are wrong. The Google Chart API is so simple yet so powerful that can give you some amazing features:
- Create charts simply by using URL with some parameters
- Inserting the chart is as simple as you would be inserting an image
- The chart is created on the fly dynamically
- No need of server side coding
- No need of JavaScript to code or view your chart
- Any resolution of the chart with only a change in URL parameters
- Manipulating the parameters of the URL would change the chart
- A variety of styles to choose as per your tastes.
Link
22December2007
Posted by Mikhail Esteves under: General.
Last week, Creative Commons turned five years old — five years of phenomenal growth, thanks in no small part to advocates like the photo-sharing site Flickr.
Now, I don’t want to piss on CC’s birthday cake just for the fun of it. But it does seem clear that an increasing number of photographers — not just professionals but high-end hobbyists also — have become disenchanted with the Creative Commons system.
Why? Depending on who you ask, it’s because:
1. It’s taking money out of the pockets of working photographers;
2. It’s putting money into the coffers of large corporations, whose executives like CC-enabled crowdsourcing even better than Third World child labor;
3. It’s supposed to make sharing your work easier, but it often just makes it more confusing — creating the kind of misunderstandings that lead to lawsuits.
Read more
21December2007
Posted by Mikhail Esteves under: Links.
Outfitting your computer with the latest software can be expensive. Time and money aren’t things to be wasted. With sky rocketing prices for desktop applications, you need to arm yourself with the right alternatives.
Fortunately, there is a great alternative out there: the Internet. As hard as it is to believe, just by surfing around online, you can access most of the desktop app functionalities you need without shelling out a cent.
To prove it, here’s a list of 25 online alternatives for the most popular desktop applications that you use, want and simply must have when working online.
Link