|
|
So I was performing some maintenance work on some webform stuff in an application and ran into a problem where an existing custom control, which I have the source for so I can fix it (yay!), wasn’t properly disabling itself when it was in a container that became disabled. The way it works, it overrides the rendering process and spits out lots of HTML and javascript (eww!) but for the important things for this rendering, it looks at a custom “ReadOnly” property on the control to enable/disable the appropriate things. So essentially the control is always enabled except when that flag is set to false – a bad idea!
For now, I’ve modified that property as follows. I’ve been unable to find a “best practice” way of performing this so here is my implementation:
public bool ReadOnly
{
get
{
bool isAParentDisabled = false;
Control parentControl = Parent;
while (parentControl != null)
{
if ((parentControl is WebControl) && !((parentControl as WebControl).Enabled))
{
isAParentDisabled = true;
break;
}
parentControl = parentControl.Parent;
}
return readOnly || !Enabled || isAParentDisabled;
}
set
{
readOnly = value;
}
}
Is there a better way to perform this? I’d love to see how you do this!
-Shane
October 1st, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
Like many others, I got my Android G-1 phone a couple days before it was officially released and have been longing for when Indy would finally get 3G coverage. Lo and behold, I get out of the shower this morning to check the weather and my 3G icon is lit up, albeit with only 1-2 bars (out of 4). Did some surfing and it seemed to load quickly just like it has when I’ve traveled to 3G cities (San Diego, LA, Chicago, etc.).
Now the potential bad news. Since then, my phone has gone back to an Edge connection. I don’t know if this is because of a weak signal at my house (border of Fishers and Noblesville near Verizon Wireless Center) or if it was only on temporarily. I suspect they may just be testing it out, turning it on temporarily, and then turning it back off until they’re ready for a widespread “flip-the-switch” date or something like that.
But the good news is, Indy now has T-Mobile’s 3G in a functional manner deployed to at least parts of the city!!
[edit] After doing some testing, I’m finding that there are some locations where I would normally get the full 4 bars of Edge connection (on my G1 Android device) but I only get 1-2 bars of 3G connection. I was concerned at first until I started doing some bandwidth tests. It seems that with a 1-bar 3G connection I get the same transfer speeds as with 4 bars of 3G connection: about 850kbps.
September 9th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
With Windows 7 and Windows Server 2008 R2 recently going RTM, I’ve found myself installing them in quite a few different configurations. One configuration that I’ve recently ran into is installing it into a machine with no CD drive of any means. I know I could carry around a USB-based DVD drive but instead, I wanted to have a USB pen drive to install it from. After some research, I found that it was relatively easy to create such a tool!
- Either mount the ISO or insert the DVD for Windows 7 or Windows Server 2008 R2 into your computer. Let’s say it’s at D:\
- Format your USB stick to FAT32 (I used default settings for everything via the Windows format tool). Let’s say it’s at H:\
- Run the following command at a command prompt:
xcopy d:\*.* /s /e /f h:\
At this point, you should be able to boot off of your USB stick (pending proper BIOS settings on the machine you’re booting up from) and it will install Windows off of the flash memory! Easy as that! This has been done from Vista and Win7. I’m not sure about other OSes.
[edit]Am looking into if I’m missing something with making the device bootable. Something seems fishy here…[/edit]
August 28th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: 3 Comments |
I was working with Cody Collins and we ran into a problem recently with detecting whether the OS running was 32-bit or 64-bit from within NAnt. We’re trying to automate the installation of some software that has separate installers for 32-bit and 64-bit and we need to determine which installer to run from NAnt.
The problem begins with NAnt being compiled for 32-bit mode only which means all 64-bit functionality is transparent to it. If it weren’t for that, then we could simply depend on the PROCESSOR_ARCHITECTURE environment variable. So if you try to ask the OS if it’s 64-bit, it will tell you that it isn’t. Luckily there is an IsWow64Process WinAPI call that you can make to determine if you are running in WoW64. From these two pieces of information, you can infer whether or not the OS is 64-bit.
Cody and I were able to come up with the following scripts to determine this.
Note: This runs unmanaged code and does not protect you from crashes there – this could be better but this should get you 90% of the way there. This has been tested on Windows XP (32-bit), Windows 2003 (64-bit), Windows Vista (32-bit and 64-bit), Windows 2008 (32-bit), and Windows 7 RC (64-bit). Not an exhaustive test but it covers many of the bases.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| <property name="Is64BitOperatingSystem" value="false" />
<property name="Is64BitProcess" value="false" />
<property name="IsWow64Process" value="false" />
<target name="DetectOperatingSystemArchitecture" depends="DetectIfWow64Process,DetectIf64BitProcess">
<description>
This will detect whether the current Operating System is running as a 32-bit or 64-bit Operating System regardless of whether this is a 32-bit or 64-bit process.
</description>
<property name="Is64BitOperatingSystem" value="${IsWow64Process or Is64BitProcess}" />
<choose>
<when test="${Is64BitOperatingSystem}">
<echo message="The operating system you are running is 64-bit." />
</when>
<otherwise>
<echo message="The operating system you are running is 32-bit." />
</otherwise>
</choose>
</target>
<script language="C#" prefix="MyWin32Calls">
< code>
< ![CDATA[
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo);
[Function("IsWow64Process")]
public bool IsWow64Process()
{
bool retVal = false;
IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, out retVal);
return retVal;
}
]]>
< /code>
</script>
<target name="DetectIfWow64Process">
<description>
Detects whether we are currently in a WoW64 process or not.
</description>
<property name="IsWow64Process" value="${MyWin32Calls::IsWow64Process()}" />
<echo message="Setting the [IsWow64Process] property to ${IsWow64Process}." />
</target>
<target name="DetectIf64BitProcess">
<description>
Detects whether we are currently in a 32-bit or 64-bit process (not necessarily what the OS is running). Note that as of the time of this writing, this will ALWAYS return false because NAnt is compiled to run in 32-bit mode only.
</description>
<!-- This can return x86, x64, AMD64, or IA64 as of the time of this writing. This works for a 32-bit process in a 64-bit OS because the OS makes the 64-bitness transparent to the process in this environment variable. -->
<property name="Is64BitProcess" value="${environment::get-variable('PROCESSOR_ARCHITECTURE')!='x86'}" />
<echo message="Setting the [Is64BitProcess] property to ${Is64BitProcess}." />
</target> |
On a 64-bit OS, it has the following output:
D:\bin\deleteme\nanttest>build DetectOperatingSystemArchitecture
NAnt 0.85 (Build 0.85.2344.0; rc4; 6/2/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///D:/bin/deleteme/nanttest/test.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: DetectOperatingSystemArchitecture
[script] Scanning assembly "lsbw4oxa" for extensions.
DetectIfWow64Process:
[echo] Setting the [IsWow64Process] property to True.
DetectIf64BitProcess:
[echo] Setting the [Is64BitProcess] property to False.
DetectOperatingSystemArchitecture:
[echo] The operating system you are running is 64-bit.
BUILD SUCCEEDED
Total time: 0.2 seconds.
D:\bin\deleteme\nanttest>
Happy NAnting!!!
*heads off to the IndyALT.NET meeting on Continuous Integration now…*
July 16th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: No Comments |
I usually keep to technical topics on here but this one is going to take a step back.
In the past I have been a consultant through nearly my entire career. I have gone into new [to me] businesses, listened to what they wanted, helped them learn what they needed, helped them determine the correct solution for their need, often helped create these solutions or worked with the teams who created the solutions, helped the companies implement and deploy these solutions, helped with training, helped with post-deployment support, and anything else you can think of that goes with the territory. I have worked on single-person projects and have worked with teams ranging from 2 to 15 people. I have participated as a supporting developer, the lead developer, a supporting architect, the lead architect, a business analyst, and even a project manager on these different teams.
For the past year and a half, I have been working with the Indiana State Supreme Court on a project called eCWS. On this project I was the architect and lead developer in a team with 8 developers. My team and I designed, created, and maintained this entire system from scratch and won at least 3 international awards with the project. As of the time I rolled off of this project about a month ago the system had logged approximately 1 million citations and warnings, consisted of a laptop-based and PDA-based client (both of which were rock-solid and easily maintainable), a web-based client system, as well as some web-based server components while integrating with various electronic court systems (and of course most of these systems shared a common code-base to keep the code manageable).
Also, for the past year, I have helped to create the Indianapolis ALT.NET user group and have acted as the president of the user group. I have attempted to push a wonderful movement in furthering the community’s education on best practices and broadening the community’s range of thinking to more outside-the-box tools and techniques. As we are now, we are one of the most active and organized ALT.NET user groups in the world (and we’re about to step things up to the next level)!
For the past month I have done some consulting work for an older client of mine while waiting for negotiations and planning for “the big one” to come through. I’ve been ready to advance my career and, in doing so, will be stepping out of the consulting role I have been so successful in for years. Beginning today I will be joining the EnerGenuity team here in Indianapolis. EnerGenuity currently has a great software suite that keeps their customers happy (which include Fortune 500 and other companies). My official title, I think, is something like Technology and Product Development Manager (for the first time I’ll have a legitimate title and not one that I make up on-the-spot as so many software developers/consultants do!). In short, I will be leading the IT team for EnerGenuity. This is sure to be a challenging and rewarding experience in my life and I think EnerGenuity and I are a great match for each other! I think I have so much to offer and they have so much they need and the details in both of these seem like an absolutely perfect match!
So… that’s about it. Just thought I’d give you an update of what I was up to.
-Jax
March 2nd, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: 7 Comments |
So I was at work today with my 24″ LCD thinking, “Man, I wish I had a convenient way to organize/resize my windows such that I could see several at once beyond a generic ‘Tile Windows’ configuration.” So I remembered a little utility that kinda did this with a laptop I bought a couple years back by Acer called “Vista Grid”. But that didn’t quite tickle my fancy so I looked for some better alternatives.
The search led me to WinSplit Revolution (WSR). Yeah, it’s kind of a cheap-sounding name (kinda like www.superantispyware.com, which, by the way, is one of the better free anti-spyware apps out there!), but I really like it, plus it’s totally free!
So here were several requirements which I had for this type of utility:
- It must run on Windows XP, Windows Vista, and Windows 7
- It must allow me to configure the various “click-to” zones for windows (so I could, for instance, have one window take up 80% of the screen and 2 other windows share the remaining 20%, or something like that)
- It must run nicely on multiple monitors (something that several utilities failed to do)
- It must be free (mostly because there are free options that will be good enough)
How did most of these work?
Well, most of them worked by either doing a special thing with the mouse (such as moving it over a “click-to zone” and hovering in the same place for 5 seconds), or a keyboard shortcut placing the window in focus, or a combination of both. Some of them had special features that allowed you to “auto-tile” all active windows in a grid fashion (not just side-by-side). Some of them had special features similar to Windows 7 with some non-configurable zones. And some of them had some other not-so-important features.
Why did I choose WinSplit Revolution?
WSR wasn’t the flashiest app. It wasn’t even the easiest-to-use app. But it was the best mix of all of the above. This app requires you to type in the locations and sizes for each zone rather than giving you a GUI to configure it with (both good and bad – more flexible but requires actual thought to get it right!). This app misses some of the flashy features that I mentioned above. BUT… This app worked best with a combination of multiple monitors, flexible configuration (even with overlapping zones), and was small and speedy. That was mostly what I was looking for.
So my configuration, for instance, consists of a laptop with a 24″ LCD attached to it above the laptop (this is my “Communication Box” while working). I use it mostly for email, twitter, IM, and feed-reading window. As such, I like to keep Thunderbird in the top screen taking up 2/3 of the screen left-to-right and 100% top-to-bottom. Then the right-most third is shared between a couple Twhirl clients. But sometimes I’ll overlay Thunderbird with other windows when I need to see additional things (PDFs, Word docs, browser windows, etc.). Then on the laptop’s LCD, I mostly just maximize things so it’s not important.
Another configuration I have is a desktop that has a 24″ LCD rotated 90 degrees to the left of a 23″ LCD that’s normal. In this setup, I typically have a couple browser windows open in the rotated LCD, one on top of the other and sometimes maximized. In the main window I’ll often have Visual Studio maximized, two Visual Studios side-by-side, or sometimes a primary Visual Studio on the left half and two Visual Studios sharing the right half (if I need more than 3 instances of Visual Studio, then they move to the left screen, which HAS happened before!).
Anyways, I think you get the point. This utility allows me to make MUCH better use of my high-resolution LCDs whether they’re 19×12 (my 24″ ones) or 20×11 (my 23″ one – yeah, wierd resolution). In the end, it gets two thumbs up! And yes, I realize I posted no screen shots. That’s mostly because there isn’t much to take screenshots of! The most interesting things are textboxes where I type in percentages! If you wanna see, just download and install for yourself.
-Jax
January 12th, 2009
Categories: Random Thoughts | Author: Shane Milton | Comments: 4 Comments |
Have you ever had to send control/alt/delete via Windows Remote Desktop/Terminal Services? If you try it, it ends up being caught on your local client machine. I just stumbled upon a nice trick. If you send [CTRL] + [ALT] + [END], then it will have the effect of [CTRL] + [ALT] + [DEL].
Go try it out!
August 23rd, 2008
Categories: Random Thoughts, Windows Vista, Windows XP | Author: Shane Milton | Comments: No Comments |
I don’t know about you but I’ve got a pretty busy schedule! In about a 1-week period, I will have gone to an IndyNDA meeting, an ITEC conference, an IndyPASS meeting, and an Indy ALT.NET meeting. Trying to get all of these meetings and dates straight is kind of a PITA! Because of that, I just (over the past 5 hours or so) put up www.IndyTechEvents.com as a single site to hopefully consolidate all of the local tech events being put on.
The site is pretty simple and has a forum section and a calendar section. I don’t know how heavy the forums will be used but hopefully the calendar (the main part of it in my little dream world) will be kept up-to-date by the various location user groups and other communities. I plan on giving moderator access to the leaders of the location user groups (and perhaps a representative) so they can be in full control of their events and even any forums focused on their user groups or the technology that their user group focuses on.
I’ve gone ahead and posted all of the June events that I’m aware of but I’m sure I’ve missed some, so if you know of any, please let us know so we can fix it! And if you’re somebody who should have moderator access, let me know and I’ll make it so!
Check it out: http://www.IndyTechEvents.com
-Shane
PS. If I left out your user group, sorry! It’s now 2am and I’m sure I’m sleepier than I should be releasing a new site.
June 14th, 2008
Categories: Random Thoughts | Author: Shane Milton | Comments: 3 Comments |
I’m not sure how much customer data has been compromised or even how it was compromised (could have been an employee who manually stole some of the data) but it has been somehow compromised.
I have a relatively fail-proof and completely trackable email spam system. When I create an account online or give out my email address in some other manner, pretty much everybody I give the address to receives a unique email address. Prior to giving it out, I will create a brand new alias at my domain and have that email forwarded to my real account. So for example, if I create an account at Yahoo.com then I might create the address yahoo _at_ jaxidian.org and have it forwarded to my account.
One such account that I have created is with Donato’s to order pizza online. When I created this account, I gave them donatos _at_ jaxidian.org as my email address. Just today I began receiving spam at this email address. This means that somehow an email address that I have confidentially given to Donato’s has made its way into some spammer’s hands. This could have been an extremely isolated case where an employee stole just my address and gave it/sold it to a spammer. This could have been an attack on Donato’s systems where not just email addresses but perhaps also credit card information has been lost. I really have no clue. But alas, because Donato’s is the only company/person I have given this email address to EVER, this most likely means that Donato’s customer data has been compromised.
Perhaps I should stop paying with credit cards when I buy pizza?
-Shane
May 26th, 2008
Categories: Random Thoughts | Author: Shane Milton | Comments: 1 Comment |
When we were discussing the Indy ALT.NET group’s goals with others, we were asked, “How are you going to distinguish Indy ALT.NET from the Indy .NET User Group?” This was a GREAT question!
In coming up with that answer, I’ve mulled around and tried to come up with a definition for ALT.NET. There are plenty of posts out there that have attempted to do this but the reality of the situation is that there is not yet a single, concrete, agreed-upon answer to this. So as such, I’ll add my thoughts to that cloud of what some people think ALT.NET is.
In trying to define this, I am going to outline the process I went through in coming up with this definition. I think going through the process helps you understand what it is just a little bit better. Here was my first attempt:
The concept of ALT.NET means that you try to use all tools and techniques available in an appropriate way to do your job in the best and most efficient way possible.
The problem with this definition is that it leaves you just as confused as you were before. From this definition you would believe that ALT.NET is the same as being a good software engineer. I believe this definition is a 100% accurate definition but unfortunately, it is 90% useless. So let’s try it again and fill in not just what ALT.NET means but also what it stresses.
The concept of ALT.NET means that you try to use all tools (whether mainstream in your specific industry or not) and techniques available (whether mainstream in your industry or not) in an appropriate way (without overkill) to do your job in the best (as defined in almost any possible way) and most efficient way possible.
With these stresses, this definition starts to make a little more sense, but it’s still not all that useful. Let’s try it again and this time add a lot more to it.
The concept of ALT.NET means that you try to use all tools and techniques available in an appropriate way to do your job in the best and most efficient way possible.
The tools may come from any source whether it’s your industry or not. For example, there may be some tools that Java developers take for granted that are just completely unknown about in the .NET industry. Or perhaps there is a tool used by accountants to ensure calculations are done correctly and that tool would be an awesome yet non-obvious solution for implementing a suite of unit tests for your code.
Like the tools, the techniques may also come from any source whether it’s your industry or not. Perhaps you’re running into some architectural problems of how to lay things out and a VLSI engineer has a technique for laying out blocks of functionally-related items on their boards that an architect could use in laying out their classes.
In addition to these examples, the concept of ALT.NET even takes it one step further. Not only should one look to other industries for a tool or technique, one should also consider developing new tools or techniques to as part of the greater evolution of things. While they’re not ALT.NET-created concepts, “alternative” methodologies such as Domain Driven Design (DDD), Behavior Driven Design (BDD), and Agile Development have not always been around but had to have been dreamed up at some point. I believe ALT.NET encourages the evolution of our industry by encouraging such new “outside the box” concepts to be considered.
Now, one thing to be careful about is overusing these tools and techniques. Just as an architect needs to ensure he/she does not over-architect the system, you must also ensure you do not go overboard with these tools and techniques. They need to be used appropriately and not just for the sake of using them. In fact, often times the KISS methodology applies! When determining what tool or technique to use, you need to ensure you make such a decision to ensure you create the “best” thing you can. Best is a very vague word here that can be defined MANY different ways and that’s for you to decide. Perhaps it means the quickest solution to code. Maybe it means the fastest solution to execute (from a performance perspective). Perhaps it means the cheapest third-party tool that fits the bill. Or maybe it means the easiest for a user to interact with. The “maybes it means” list can go on forever.
Whew! I think that just might be it! I think that just might be a pretty good explanation of what ALT.NET is!
Now, while I believe that is a good definition for it, I think it’s important to discuss one more thing that has been a popular topic of debate. Is ALT.NET divisive? I am going to change the question a little bit and not answer whether it is or not but rather it should be (to me the difference in the questions are due to the rude and perhaps elitist behavior of some individuals and not the fundamental concept of the ALT.NET movement).
So, should ALT.NET be divisive? My answer is a simple “no.”
Let’s go back to my very first definition of what ALT.NET is:
The concept of ALT.NET means that you try to use all tools and techniques available in an appropriate way to do your job in the best and most efficient way possible.
As I stated before, this definition essentially means that you are simply trying to be the best software engineer that you can be! Again, I believe this is a 100% accurate definition. And by this definition, there should be absolutely no division created within our industry because of ALT.NET. This is what all of our peers should be doing. ALT.NET focuses on some non-mainstream things and in some scenarios such things are the “best” way of doing things but there are certainly times when they’re not the “best” way of doing things. The only question that remains is what exacly that “best” word means to you. Let’s use some examples.
Consider that you’re a consultant working on a small application for a non-profit company where the code will later be maintained by college students on a somewhat casual basis. In this case would it make sense to invest in a potentially complex way of architecting the system so that it follows a generic, standard philosophy? Perhaps but probably not if it is going to be too complex for the college students to easily (and safely) maintain.
Now consider that you’re a software development shop that regularly works on custom projects for clients. In this scenario, your business model could be built around efficiently pumping out successful projects in a repeatable fashion. In this case would it make sense to invest in a potentially complex way of architecting the system so that it follows a generic, standard philosophy? Probably so once you have nailed such a thing down you can repeat it regularly to increase productivity in the future.
One more example. Consider that you’re the said software development shop above and you are working on a very critical project with a tight deadline and you have not yet mastered this new architecture. In this case would it make sense to invest in a potentially complex way of architecting the system so that it follows a generic, standard philosophy? I would say probably not. Any significant fundamental change to your current process can introduce some very significant risks. With that being said, many of the topics that ALT.NET covers can introduce significant risks if they’re used in inappropriate situations or are not done well (which can very well happen since they’re not very widely understood in the industry and not many people have much experience with a lot of these things). So you must consider that doing such a thing can be a big risk.
In the last example, I hit on one very big thing and that is that many of the ALT.NET-focused topics bring a lot of risk with them because they are not yet really all that proven to be successful. There are many companies and situations where this is unacceptable and in those cases, the mainstream tools and techniques should probably be considered. This is not to say that the ALT.NET-focused topics are “too difficult” for certain people. It has nothing to do with that at all! It has everything to do with that “best” word. But I think people who determine that the ALT.NET topics aren’t currently “best” for them may still want to consider following the ALT.NET topics for their personal professional development. Increasing your awareness of various things is a good thing, afterall!
Now I want to end this post with a last closing thought. Personally to me, my interest in this ALT.NET movement has two motivations to it:
- I want to learn about some of these neat new things that I’ve never heard about before!
- I want our Indianapolis development community as a whole to learn about some of these neat new things too!
-Shane
EDIT: 4/30/2008 4:13pm EST
I have been asked for some links on various community sites by some people who are just now being introduced to the ALT.NET movement. Here are a few links to get you started. Over the next day or two I’ll see if I can get a “History of ALT.NET” post up.
David Laribee’s coining the term ALT.NET
AltNetPedia.com
MSDN Magazine article on ALT.NET
ASP.NET Podcast Show #103 – ALT.NET with David Laribee
April 27th, 2008
Categories: .NET, ALT.NET, Programming, Random Thoughts | Author: Shane Milton | Comments: 2 Comments |
Next Page »
|