I had a hard time deciding if the title should be "programming with a mouse considered harmful" or "real programmers don't use a mouse"; but I think you get the idea
I'm mentoring a guy right now, and he started using the mouse to move around in the code, I told him
"don't use the mouse, that's a bad practice"
It doesn't matter how many years you have been programming, if you use the mouse, you are implicitly slow, you can do things at least twice as fast using only the keyboard.
leave the mouse for things that you don't usually do, but for everything that you are doing in code there absolutely no reason to use the mouse; if you are new to programming it should be a lot easier to learn to use all the shortcuts, if you have been programming for a while is definitely harder (and you probably think you're better off without them at this point) but you would definitely increase your programming speed
I am known for being pretty fast (and they say I'm cocky for that matter), but one of the main reasons I'm fast is because I learn to use the shortcuts, I had a hard time switching from Delphi IDE to VS, but I did it without remapping the keyboard to use "Delphi IDE style", I think it's a bad idea to remap the keyboard to your specific style, specially is you do some type of pair programming (you are doing paired programming, right?)
you don't have to learn all of the shortcuts available, just the ones for all the little tasks that you do commonly when programming
use the keyboard, program faster
Saturday, March 10, 2007
Wednesday, March 07, 2007
let's all just develop ASP.NET in notepad / is not about the tools
Jeremy Miller started a conversation on .NET testability (or the lack there of), Ayende agrees with him
I can definitely see this, I have suffered from this... but!
I don't think the problem is with the tools, in any case the problem would be of the TDD community, Ruby on Rails is open source, why can't we create asp.net on steroids?
seems like we know exactly what we want, the concept is there, the code is there, just needs to be implemented in .NET
there was a provocative comment to Jeremy's post:
"What if I want RAD and I don't want tests?"
there are some strong arguments against this, but the truth is for most developers that's all they want
everyone can say X sucks, Y in this other language is much better, why can't we say let's create Y for asp.net?
would people really use it? or is this just a TDD religion thing? (I'm gonna get in trouble for this)
I'll tell you what, that's exactly the reason why Microsoft didn't put something like that in ASP.NET, TDD advocates are not the broad audience, the majority of the "developers" don't really know or care about TDD or refactoring or patterns and practices, they just "want stuff to work", and yes, the rest of us have to pay the price, but nobody is forcing you to use RAD if it doesn't work, you have to use the right tool.
I can agree with this:
is kinda late, I was just kidding with Notepad and I've just hit another trip around the sun...
I can definitely see this, I have suffered from this... but!
I don't think the problem is with the tools, in any case the problem would be of the TDD community, Ruby on Rails is open source, why can't we create asp.net on steroids?
seems like we know exactly what we want, the concept is there, the code is there, just needs to be implemented in .NET
there was a provocative comment to Jeremy's post:
"What if I want RAD and I don't want tests?"
there are some strong arguments against this, but the truth is for most developers that's all they want
everyone can say X sucks, Y in this other language is much better, why can't we say let's create Y for asp.net?
would people really use it? or is this just a TDD religion thing? (I'm gonna get in trouble for this)
I'll tell you what, that's exactly the reason why Microsoft didn't put something like that in ASP.NET, TDD advocates are not the broad audience, the majority of the "developers" don't really know or care about TDD or refactoring or patterns and practices, they just "want stuff to work", and yes, the rest of us have to pay the price, but nobody is forcing you to use RAD if it doesn't work, you have to use the right tool.
I can agree with this:
I really think the .Net community needs to reexamine and debate the merits and appropriateness of the Visual RAD approach.the key here is the .NET community, people keep asking Microsoft to solve all these problems, are these problems really the developer's problem? or is it just TDD community problem? how big is that community?, where is the community? why can't that community do it? let's stop blaming it on something else
is kinda late, I was just kidding with Notepad and I've just hit another trip around the sun...
Labels:
software literature,
TDD
what are those S-1-5... things I see on the security tab?
sometimes you right click/properties/security on things like files and you see some garbled things like S-1-5-7blablabla...
They are called security identifiers (SID), I bet at some point you thought that they were just "messed up things" or garbage or something like that?
well, they actually have a meaning, here's a full list:
Anonymous Logon (S-1-5-7): A user who has connected to the computer without supplying a user name and password.
Authenticated Users (S-1-5-11): Includes all users and computers whose identities have been authenticated. Authenticated Users does not include Guest even if the Guest account has a password.
Batch (S-1-5-3): Includes all users who have logged on through a batch queue facility such as task scheduler jobs.
Creator Owner (S-1-3-0): A placeholder in an inheritable access control entry (ACE). When the ACE is inherited, the system replaces this SID with the SID for the object's current owner.
Creator Group (S-1-3-1): A placeholder in an inheritable ACE. When the ACE is inherited, the system replaces this SID with the SID for the primary group of the object's current owner.
Dialup (S-1-5-1): Includes all users who are logged on to the system through a dial-up connection.
Everyone (S-1-1-0): On computers running Windows Server 2003 operating systems, Everyone includes Authenticated Users and Guest. On computers running earlier versions of the operating system, Everyone includes Authenticated Users and Guest plus Anonymous Logon.
For more information, see Differences in default security settings.
Interactive (S-1-5-4): Includes all users logging on locally or through a Remote Desktop connection.
Local System (S-1-5-18): A service account that is used by the operating system.
Network (S-1-5-2): Includes all users who are logged on through a network connection. Access tokens for interactive users do not contain the Network SID.
Self (or Principal Self) (S-1-5-10): A placeholder in an ACE on a user, group, or computer object in Active Directory. When you grant permissions to Principal Self, you grant them to the security principal represented by the object. During an access check, the operating system replaces the SID for Principal Self with the SID for the security principal represented by the object.
Service (S-1-5-6): A group that includes all security principals that have logged on as a service. Membership is controlled by the operating system.
Terminal Server Users (S-1-5-13): Includes all users who have logged on to a Terminal Services server that is in Terminal Services version 4.0 application compatibility mode.
Other Organization (S-1-5-1000): Causes a check to ensure that a user from another forest or domain is allowed to authenticate to a particular service.
This Organization (S-1-5-15): Added by the authentication server to the authentication data of a user, provided the Other Organization SID is not already present.
that's it! now you still don't know what they are because you didn't read this thing, but you have a reference that you can keep in your bookmarks
They are called security identifiers (SID), I bet at some point you thought that they were just "messed up things" or garbage or something like that?
well, they actually have a meaning, here's a full list:
Anonymous Logon (S-1-5-7): A user who has connected to the computer without supplying a user name and password.
Authenticated Users (S-1-5-11): Includes all users and computers whose identities have been authenticated. Authenticated Users does not include Guest even if the Guest account has a password.
Batch (S-1-5-3): Includes all users who have logged on through a batch queue facility such as task scheduler jobs.
Creator Owner (S-1-3-0): A placeholder in an inheritable access control entry (ACE). When the ACE is inherited, the system replaces this SID with the SID for the object's current owner.
Creator Group (S-1-3-1): A placeholder in an inheritable ACE. When the ACE is inherited, the system replaces this SID with the SID for the primary group of the object's current owner.
Dialup (S-1-5-1): Includes all users who are logged on to the system through a dial-up connection.
Everyone (S-1-1-0): On computers running Windows Server 2003 operating systems, Everyone includes Authenticated Users and Guest. On computers running earlier versions of the operating system, Everyone includes Authenticated Users and Guest plus Anonymous Logon.
For more information, see Differences in default security settings.
Interactive (S-1-5-4): Includes all users logging on locally or through a Remote Desktop connection.
Local System (S-1-5-18): A service account that is used by the operating system.
Network (S-1-5-2): Includes all users who are logged on through a network connection. Access tokens for interactive users do not contain the Network SID.
Self (or Principal Self) (S-1-5-10): A placeholder in an ACE on a user, group, or computer object in Active Directory. When you grant permissions to Principal Self, you grant them to the security principal represented by the object. During an access check, the operating system replaces the SID for Principal Self with the SID for the security principal represented by the object.
Service (S-1-5-6): A group that includes all security principals that have logged on as a service. Membership is controlled by the operating system.
Terminal Server Users (S-1-5-13): Includes all users who have logged on to a Terminal Services server that is in Terminal Services version 4.0 application compatibility mode.
Other Organization (S-1-5-1000): Causes a check to ensure that a user from another forest or domain is allowed to authenticate to a particular service.
This Organization (S-1-5-15): Added by the authentication server to the authentication data of a user, provided the Other Organization SID is not already present.
that's it! now you still don't know what they are because you didn't read this thing, but you have a reference that you can keep in your bookmarks
Thursday, March 01, 2007
dude!, I'm not getting a dell, I'm getting a Mac
and one of the main reasons why is parallels. We have seen virtual machines in all the operating systems for quite a while now, where the guest operating system sits there in it's own window.
Parallels takes this to a whole new level, it allows you to integrate the Mac and the guest OS into the same workspace! such that you can switch applications from a Mac app to a Windows app all in the same workspace (desktop), that's amazing!
take a look at the picture to see more detail, both Mac apps and Windows apps "blend" seamlessly although the apps still live in a different OS,
The apps running in windows show up in the Mac "toolbar".
It even allows you to copy and paste between the two (and according to Justin you can also drag and drop)
that's good software.
dude!, I'm getting a Mac... just wait 'til Leopard comes out =o)
Labels:
Mac
Monday, February 26, 2007
This is what happens when you forget to deploy your Telerik RadControls folder
This article applies specifically to applications developed using Telerik Rad Controls
I was having a stupidus momentus (tm) yesterday, I forgot to deploy the RadControls and I kept getting this error:
Object reference not set to an instance of an object.
at Telerik.WebControls.RadWindowManager.BuildTemplates()
at Telerik.WebControls.RadWindowManager.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at Telerik.WebControls.RadAjaxManager.AJAX_Page_Render(HtmlTextWriter output, Control container)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Telerik could do better with their exception handling, but anyway... I just needed another pair of eyes to see the issue
I was having a stupidus momentus (tm) yesterday, I forgot to deploy the RadControls and I kept getting this error:
Object reference not set to an instance of an object.
at Telerik.WebControls.RadWindowManager.BuildTemplates()
at Telerik.WebControls.RadWindowManager.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at Telerik.WebControls.RadAjaxManager.AJAX_Page_Render(HtmlTextWriter output, Control container)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Telerik could do better with their exception handling, but anyway... I just needed another pair of eyes to see the issue
Labels:
bugs,
third party
Tuesday, February 20, 2007
My name
Miguel de Icaza (one of the guys behind Mono) tells us how "english speakers" mispronounce his name (Mi-goo-elle), I don't think that's bad at all, in my case I get
ee-ber
Aber
A-bear
Heber
and let's not even try my last name
I have to explain that my name is like in "forever"... but most of the time I don't even bother now, you just get used to it
ee-ber
Aber
A-bear
Heber
and let's not even try my last name
I have to explain that my name is like in "forever"... but most of the time I don't even bother now, you just get used to it
Labels:
personal
Thursday, February 15, 2007
time for a refactorer job title
from Jeff Atwood post code smaller
but I have seen this problem over and over again in many different teams, and the sad part is that the problem is not specific to new developers, experienced developers keep doing it the same way
It seems is time for a new job title whose primary responsibility is to refactor code, and the members of the team should learn from him and start to follow
of course the actual job title would have to be much cooler than "Refactorer"
It's up to us to resist the natural tendency of any project to snowball into a giant rolling Katamari ball of code. Code smaller!for the last 4-6 months I have eliminated about 3-5 times more code than I have written (maybe more than that!?), specially using generics, as everything else in life (hopefully) you get better at it the more you do it.
but I have seen this problem over and over again in many different teams, and the sad part is that the problem is not specific to new developers, experienced developers keep doing it the same way
It seems is time for a new job title whose primary responsibility is to refactor code, and the members of the team should learn from him and start to follow
of course the actual job title would have to be much cooler than "Refactorer"
Labels:
software literature
Wednesday, February 14, 2007
Before you ask...
nowadays everyone thinks they know how to use google (pretty much in the same way people assume they know how to use Windows... sigh)For a lot (most?) of things it works fine by entering a few words (although it helps to know which words you shouldn't put on your search), but sometimes is not so easy to find the stuff, that's when you need to use your google search skills, at minimum you need to know these ones:
- intitle:
- link:
- site:
- intext:
- inanchor:
- inurl:
- filetype:
- define:
- using quotes
- using wildcards
- using OR, AND
- using -
- using ranges
If you don't know how to use all the "commands" on this list, you are missing a lot.
There are many other interesting tools built right into google.com, like:
- calculator
- conversions
- UPS, Fed Ex, USPS tracking information
- VIN information
- movies
- etc, etc, etc
check this page for a very complete list of things you can do with google, included all of the items in my list
Tuesday, February 13, 2007
good bye username and password
Whenever you use user names and passwords in your applications, consider using System.Net.NetworkCredential to pass the information around functions, it encapsulates those fields, and allows you to extend in the future to maybe use a domain as well.
In my case we're using it in a plugin architecture to authenticate against any system, using this class encapsulates those fields and allows the plugin to authenticate against most standard systems as it is not tied specifically to username and password
In my case we're using it in a plugin architecture to authenticate against any system, using this class encapsulates those fields and allows the plugin to authenticate against most standard systems as it is not tied specifically to username and password
Saturday, February 10, 2007
magic variables to help in exception debugging
This article applies to C#, J#, and Visual Basic.
I read about these variables a long time ago in some blog, but I could not find anything about those hidden little things, mainly the problem was that they are not called magic or hidden, they are documented and are called Pseudovariables;
Anyway, I don't think many people know about them, here they are:
try {
//some code
} catch (Exception e) {
//don't really need e here, just to get the exception information on the Watch window
}
you could write this code as:
try {
//some code
catch { } //put the breakpoint on this line, inspect $exception (Debug, Watch, Watch 1, type $exception there)
and get the same information.
The $user pseudovariable is pretty self explanatory.
in native code you have a few more pseudovariables available, check the link if you are interested.
those little things...
I read about these variables a long time ago in some blog, but I could not find anything about those hidden little things, mainly the problem was that they are not called magic or hidden, they are documented and are called Pseudovariables;
Pseudovariables are terms used to display certain information in a variable window or the QuickWatch dialog box. You can enter a pseudovariable the same way you would enter a normal variable. Pseudovariables are not variables, however, and do not correspond to variable names in your program.
Anyway, I don't think many people know about them, here they are:
- $exception: Displays information on the last exception. If no exception has occurred, evaluating $exception displays an error message.
In Visual C# only, when the Exception Assistant is disabled, $exception is automatically added to the Locals window when an exception occurs. - $user: Displays a structure with account information for the account running the application. For security reasons, the password information is not displayed
try {
//some code
} catch (Exception e) {
//don't really need e here, just to get the exception information on the Watch window
}
you could write this code as:
try {
//some code
catch { } //put the breakpoint on this line, inspect $exception (Debug, Watch, Watch 1, type $exception there)
and get the same information.
The $user pseudovariable is pretty self explanatory.
in native code you have a few more pseudovariables available, check the link if you are interested.
those little things...
Friday, February 09, 2007
DOS attack on google using google tools?
just noticed this post on the Google Operating System blog that shows how to backup your blogspot hosted blog, it basically allows you to run a query like this:
http://ebersys.blogspot.com/search?max-results=N
that retrieves N posts for such blog
but what if the bad guys just decide to use that and query a bunch of blogspot pages all at the same time? that would be a lot of data coming from the google servers, I just tried this one
http://googlesystem.blogspot.com/search?max-results=2000
and it took quite a while to download
the fix would be easy, they can put restrictions on who can run the query, for example just require that the blogspot user is authenticated and you can only run the query on your blog
unless google doesn't care and they can handle that just fine, we'll see
As a general rule, unless you are part of google, don't allow your users to run queries that return all the rows in your tables... is not a good thing
http://ebersys.blogspot.com/search?max-results=N
that retrieves N posts for such blog
but what if the bad guys just decide to use that and query a bunch of blogspot pages all at the same time? that would be a lot of data coming from the google servers, I just tried this one
http://googlesystem.blogspot.com/search?max-results=2000
and it took quite a while to download
the fix would be easy, they can put restrictions on who can run the query, for example just require that the blogspot user is authenticated and you can only run the query on your blog
unless google doesn't care and they can handle that just fine, we'll see
As a general rule, unless you are part of google, don't allow your users to run queries that return all the rows in your tables... is not a good thing
Thursday, February 08, 2007
protected, internal, protected internal... are you sure you know them?
the code for this article applies to C#
We all take access modifiers for granted, but can you tell me what protected internal does?
I bet more than half .NET developers will get that wrong, let's review:
If you don't believe me go check it out your self:
Assembly1:
public class Test {
protected internal string prop1;
}
Assembly2://after adding a reference to Assembly 1
public class Test2: Test {
public string prop2;
public Test2() {
prop2 = prop1; //came from the other assembly's class protected internal member
}
}
if this is news for you, you might think, that's stupid, how do you get a property to be visible only the the current assembly, current class and derived classes?
quite simple, you mark your class as internal, so your class can only be accessed from the current assembly, and you mark your property as protected, thus giving access to the derived classes only in the current assembly:
internal class Test {
protected string prop1; //accessible only in this assembly in this class and derived classes
}
We all take access modifiers for granted, but can you tell me what protected internal does?
I bet more than half .NET developers will get that wrong, let's review:
- private:
- This is the least permissive access level.
- Accessible only within the body of the class or the struct in which they are declared.
- Nested types in the same body can also access those private members
- public:
- This is the most permissive access level.
- There are no restrictions on accessing public members, they are visible anywhere the class is visible
- protected:
- Access is limited to the containing class or types derived from the containing class.
- which means you cannot create an instance of a class and have access to protected members.
- internal:
- Access is limited to the current assembly.
- protected internal:
- Access is limited to the current assembly or types derived from the containing class.
If you don't believe me go check it out your self:
Assembly1:
public class Test {
protected internal string prop1;
}
Assembly2://after adding a reference to Assembly 1
public class Test2: Test {
public string prop2;
public Test2() {
prop2 = prop1; //came from the other assembly's class protected internal member
}
}
if this is news for you, you might think, that's stupid, how do you get a property to be visible only the the current assembly, current class and derived classes?
quite simple, you mark your class as internal, so your class can only be accessed from the current assembly, and you mark your property as protected, thus giving access to the derived classes only in the current assembly:
internal class Test {
protected string prop1; //accessible only in this assembly in this class and derived classes
}
Sunday, February 04, 2007
VS2005, VS2007 (Orcas), XNA, LINQ, WPF in Vista
how is that for a title... =o)
Justin and I were playing today with these technologies, it wasn't so much fun as we expected, in short all those things don't work together in Vista, if you want more details read on
Justin and I were playing today with these technologies, it wasn't so much fun as we expected, in short all those things don't work together in Vista, if you want more details read on
- VS2005 doesn't work on Vista, it crashes randomly and very often
- VS2007 works fine on Vista
- XNA development is not supported on VS2007 or Vista, only in VS2005 Express
- the latest WPF is not supported in VS2007, only in VS2005
- LINQ works fine on VS2007
Tuesday, January 30, 2007
The type initializer for * threw an exception
The type initializer for *insert your favorite class here* threw an exception
This was driving me crazy, there's not a whole lot of info out there about this error, I should've used my psychic debugging powers (yes, I have those too =op) before
my scenario is a web service (.net 2.0) calling (deep down) into some code that does reflection to instantiate some classes, the exact same code works just fine under a web application, that's what's bizarre, how's a web service different to a web app on regards to permissions and security?
anyway, almost from the beginning I suspected it had to do with permissions, but being a web service, and the same code running fine under the web app made me leave that as a last option, so I looked and didn't find any real answer, then decided to configure a different user (with more permissions than the default asp_net) in IIS to run my web service, it ran just fine after that
ok, now I know the problem is permissions but I'm not happy with the "fix", so I'll keep looking and trying for a more elegant solution
free tip for those of you who may not know this one
enter "The type initializer for * threw an exception" in google... it's a beautiful thing, Google takes wild cards as part of a search, it works with multiple wild cards in one phrase too
This was driving me crazy, there's not a whole lot of info out there about this error, I should've used my psychic debugging powers (yes, I have those too =op) before
my scenario is a web service (.net 2.0) calling (deep down) into some code that does reflection to instantiate some classes, the exact same code works just fine under a web application, that's what's bizarre, how's a web service different to a web app on regards to permissions and security?
anyway, almost from the beginning I suspected it had to do with permissions, but being a web service, and the same code running fine under the web app made me leave that as a last option, so I looked and didn't find any real answer, then decided to configure a different user (with more permissions than the default asp_net) in IIS to run my web service, it ran just fine after that
ok, now I know the problem is permissions but I'm not happy with the "fix", so I'll keep looking and trying for a more elegant solution
free tip for those of you who may not know this one
enter "The type initializer for * threw an exception" in google... it's a beautiful thing, Google takes wild cards as part of a search, it works with multiple wild cards in one phrase too
Monday, January 29, 2007
formatting 0, 1 as yes, no or whatever
This is something we all have done at some point, convert a 0,1 value into yes, no, on, off, etc string
turns out there is a function in the BCL that can do this, string.Format will do the job
Console.WriteLine(string.Format("{0:yes;;no}", 0)); //will output "no"
Console.WriteLine(string.Format("{0:yes;;no}", 1)); //will ouput "yes"
and just for the heck of it
Console.WriteLine(string.Format("{0:yes;;no}", -1)); //will output "-yes"
...one of those little thingies
turns out there is a function in the BCL that can do this, string.Format will do the job
Console.WriteLine(string.Format("{0:yes;;no}", 0)); //will output "no"
Console.WriteLine(string.Format("{0:yes;;no}", 1)); //will ouput "yes"
and just for the heck of it
Console.WriteLine(string.Format("{0:yes;;no}", -1)); //will output "-yes"
...one of those little thingies
Tuesday, January 16, 2007
xna programming: pre-requisites
A few moons ago (WOW, it has been a while) I promised I would write a small game and post all my experiences and source code here, we did the game design, set the goals and started writing the game, then after getting sick, the holidays, updates to the XNA framework, etc, kinda stopped working on the game. anyway, I decided to pick it up and started studying xna tutorials again to see what kind of things I had done wrong due to my lack of knowledge, it seems I wasn't doing so bad so I can actually update the tools (since there is an official xna release now), modify a couple things on my code and I'm good to go
however there are a couple (big) things you need to download and install before we can continue
- Visual C# 2005 Express, you might want to NOT download the MSDN help for it though, that's an extra 2GB or so, VC#2005 Express can be downloaded here, and if you have any firewall issues you could download an offline installation (CD) here
- DirectX Software Development Kit, which includes XACT, a tool that will help you create and work with sounds
- XNA GSE (Game Studio Express), this is the thing that will allow you to create a xna project and conect all the dots so you can easily write xna apps, however beaware of the following:
'til next time
however there are a couple (big) things you need to download and install before we can continue
- Visual C# 2005 Express, you might want to NOT download the MSDN help for it though, that's an extra 2GB or so, VC#2005 Express can be downloaded here, and if you have any firewall issues you could download an offline installation (CD) here
- DirectX Software Development Kit, which includes XACT, a tool that will help you create and work with sounds
- XNA GSE (Game Studio Express), this is the thing that will allow you to create a xna project and conect all the dots so you can easily write xna apps, however beaware of the following:
- Only supported on Microsoft® Windows® XP SP2 (all editions) at this time. Windows Vista will be available only in a future beta release of XNA Game Studio Express.
- Hardware requirements are identical to those for Visual Studio 2005 plus a graphics card that supports DirectX 9.0c and Shader Model 1.1 (Shader Model 2.0 support recommended).
- This release requires Microsoft Visual C# 2005 Express Edition to be installed before proceeding. You can install Visual C# Express from the Visual C# Express Download Page. However, other members of the Visual Studio 2005 line of products, for example Visual Studio 2005 Professional, can co-exist with XNA Game Studio Express on the same computer.
- Installation of the XNA framework is not necessary on systems with XNA GSE installed
'til next time
Labels:
xna
Saturday, January 13, 2007
dummy interview question
is this code:
A)
a1 = new SomeClass();
a2 = new SomeClass();
equivalent to:
B)
a1 = a2 = new SomeClass();
??
(explain why)
The trick is how you ask the question, if you asked "what's the difference between option a and option b?" you are already telling them there is a difference.
A)
a1 = new SomeClass();
a2 = new SomeClass();
equivalent to:
B)
a1 = a2 = new SomeClass();
??
(explain why)
The trick is how you ask the question, if you asked "what's the difference between option a and option b?" you are already telling them there is a difference.
Labels:
interview questions
Friday, January 12, 2007
Thursday, January 11, 2007
Tuesday, January 09, 2007
suggestion for google reader
I can start items and share items, that's great, how about you allow me to highlight stuff?
Labels:
google,
suggestions
Subscribe to:
Posts (Atom)

