As I start to work with silverlight more I’ve always had this question in the back of my mind. When you have different states in (say for example a login area, some sort of search with a grid, and another area to edit your profile, this would be similar to 3 different pages) the silverlight application am I doing the right thing with building a “state” engine that toggles the visibility of the different areas.
Anyone else doing it another way?
Up and out!
admin Technology
Do you hate closing the lid of your MacBook Pro and forget it for a few hours? Next thing you know you’ve drained your batteries, and your pissed off.
I remember showing up to do a presentation. When I left my house I had 100% of the battery life–I show up to my meeting and my Macbook Pro won’t start. I remembered dang, I wish my MacBook would hibernate. Well, after about the 5th time of it dying I decided I should see if there is a solution.
Here is the solution.
Open up the terminal. Paste in this command. Whola. Your MacBook Pro hibernates when you close your lid everytime..
sudo pmset -a hibernatemode 0
Here are the other types of hibernate you can use:
This should return one of the following:
- 0 - Legacy sleep mode. It will save everything to RAM upon sleeping but does not support “Safe Sleep”. Very fast sleep.
- 1 - Legacy “Safe Sleep”. This is the “Safe Sleep”. Everything your laptop goes into sleep, it will save everything to harddisk. Slow on Sleep and Startup.
- 3 - Default. As described above, when sleeping, contents are saved to RAM. When battery runs out, hibernate occurs.
- 5 - Behaves as 1 but applicable only for modern Mac that uses “Secure virtual memory”.
- 7 - Behaves as 3 but applicable only for modern Mac that uses “Secure virtual memory”.
Up and out.
admin Miscellaneous
If you need to do any Response.Redirect in your code you need to add this little snipplet in your global.asax file or your ajax will break.
void Application_Start(object sender, EventArgs e) {
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
}
admin Miscellaneous
I’ve officially received my android phone. So far, it’s been quite a unique expierence. Rather than tying everything down like Apple’s iPhone. Android is 100% customizable (if you have an unlocked and root access to your phone).
Pros
Not built in object-c. I’m not a big fan of object c. It’s way to verbose. Java although one might argue is just as verbose, is in my opinion a better platform. The language is open to almost any operating system, so you don’t have to buy a mac to start building applications right away.
The interface is pretty solid.
Uses google to push contacts / calendar items to my phone.
I actually have keys to text on. (With vienna sausage fingers it’s kinda hard to text on the iPhone).
Camera is nicer.
Cons
Apple has a nicer interface.
On AT&T I only get G2 speeds.
Not as many apps (although some of them are way cooler)
What are you opinions?
Up and out!
admin Miscellaneous
Here are some tips I’ve come across for all of you that are having slowness.
- I’ve have been reading online that if you right click on the Internet Explorer and run as administrator it can speed things up (in vista / windows 7) only.
- If your browser is taking 10 - 20 seconds to load. Try changing the startup pages as described in my previous post.
- Make sure you have all your Microsoft updates installed.
- If all else fails. Reinstall. (I haven’t had to do that yet, but I have had to do all the things above to get it to work)
Unfortunately, IE 8 is not going away anytime soon. Internet Explorer still accounts for a great percentage of people out there.
Have you all had any luck with any other solutions?
Up and out!
admin Miscellaneous
I’m getting pretty stoked about going snowboarding today. This will be my 2nd time in two weeks. Last week I went up to Powder Mountain. I boarded for a half day, then skiied for the remainer.
Powder Mountain has really become quite a nice resort–especially after the 2002 Olympics here in Salt Lake City, Utah. The lodges were very nice. They had marble flooring (which made me wonder, when you have ski boots or boarding boots on, wouldn’t that make it slippery?). We actually at lunch on top of the mountain. It was very pretty and the view was awesome. We also happened to eat just in time, as soon as we sat down, I swear the whole mountain entered in the lodge on top of the mountain.
At Powder Mountain, in the morning, the lifts were not as crowded. As the day progressed, I would almost always run into “ski” school kids, and other boarders and skiiers. It was kind of frusterating as I would have to maneuver in and out of the kids and other people.
At the end of the day–my Dad, brother, and I were able to catch the last lift up the mountain. It was a nice relief to come down the mountain without and reservations.
Anyways, I’m getting ready to go out and board. It’s going to be exciting and fun!
Up and out!
admin Miscellaneous
Last night I installed IE8. I’ve been playing around with it for awhile now, but alwasy seemed to uninstall it becuase it was so slow.
After messing around with it, I figured out how to make it faster.
- Tools -> Internet Options
- General Tab -> Click on Use Blank
- Click Ok
After doing some research, it seems like when you have a page stored as your default, it tries to load that page, and if you have a script intensive site like MSN then it tries to load it every time you open a tab.
Who knows, that’s just ben my observation, and the _Blank startup page makes my browsing expierence 200% better.
Any other fixes out there?
Up and out!
admin Miscellaneous
Asp.net MVC used to have a checkboxlist in the html helper class. I was sad when they removed it, so I decided to resurrect it. I tried to keep it lightweight without adding bloat.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Text;
using System.Web.Routing;
namespace System.Web.Mvc {
public static class CheckBoxListHelper {
/// <summary>
/// Builds a CheckBoxList with selected items.
/// </summary>
/// <param name="Name">Used in to name the collection of checkboxes</param>
/// <param name="items">List<ListItems> items you want selected</param>
/// <returns>Html</returns>
public static string CheckBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> items) {
return CheckBoxList(helper, name, items, null);
}
public static string CheckBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> items, IDictionary<string, object> checkboxHtmlAttributes) {
StringBuilder output = new StringBuilder();
foreach (var item in items) {
output.Append("<div class=\"fields\"><label>");
var checkboxList = new TagBuilder("input");
checkboxList.MergeAttribute("type", "checkbox");
checkboxList.MergeAttribute("name", name);
checkboxList.MergeAttribute("value", item.Value);
// Check to see if it's checked
if (item.Selected)
checkboxList.MergeAttribute("checked", "checked");
// Add any attributes
if (checkboxHtmlAttributes != null)
checkboxList.MergeAttributes(checkboxHtmlAttributes);
checkboxList.SetInnerText(item.Text);
output.Append(checkboxList.ToString(TagRenderMode.SelfClosing));
output.Append(" " + item.Text + "</label></div>");
}
return output.ToString();
}
}
}
Sample usage:
<%= Html.CheckBoxList(”Category”, (List<SelectListItem>)ViewData["Categories"])%>
I’ll be improving on it in the future, but it’s here to help out for those of you that want a checkboxlist.
Up and out!
admin Miscellaneous
When I was first introduced to asp.net MVC, it smelled a little asp-"ish". After playing around with it in the alpha stages almost 2 years ago, I can say it is nothing like asp.
I am happy to finally be able to use it in a production environment (opps I already was on a few of my projects).
You can download the framework here.
Congrats asp.net mvc team!
admin Miscellaneous
Here is my global svn ignore pattern.
*.resharperoptions Web_Data log */[Bb]in [Bb]in */obj obj */TestResults *bin *obj RECYCLER Bin *.user *.suo *.dcu __history ModelSupport_* *.rsm thumbs.db *.user *.pdb *.dll *.suo *.exe obj */obj bin */bin temp */temp */Bin *Bin/* *.projdata *.o *.ncb *.pyc *.webinfo *.refresh TestResults */TestResults
I use this on a daily basis…
admin Miscellaneous