DevExpress is beautiful and I love to code it, but ...
I swear, it is NOT possible to publish a DevExpress application without something going wrong.
I follow the same publish procedure, and something different happens every time.
Monday, November 2, 2015
Will Microsoft ever learn how to run updates correctly?
I'm sorry, but with Windows 8.1, Microsoft has finally delivered their WORST update system, ever.
I'm talking about the automatic, scheduled updates. Microsoft gives you something like:
Updates must be completed to blah blah blah...
Your computer will restart in 1h 23mins....
If you choose Later, your PC will automatically restart in one day.
It's the third line that kills me. They were brutally honest about it too. Let's say you choose Later (because, ya know, you're a normal person that's got shit to do right now). Within 24 hours, Microsoft will automatically turn off your computer.
Ya know.. no warning or anything.
So there you are in an important meeting or writing up an important document online, and boom.... your computer turns off.
WHAT!?????????????????
You can't just do that! What the fuck? All that shit I had open? Sure, most of the programs have autosave, so you might not lose a whole ton of work, but it's the principle of the thing. If you want your customers to hate you, then you're doing a great job Microsoft. Bravo!
Actually now that I think of it, Windows 7 was kind of worse. In Windows 7, sometimes they would just restart your PC without even giving you ANY indication (for instance, if it's locked). And they would restart little to none of the apps you had open.
So overall, Windows 10 BETTER have a decent update system. It's sad to say that as a gamer and developer, I am stuck with a horrific update system. Thanks Microsoft.
Wednesday, May 27, 2015
F12 is downright dangerous.
So, F12.
In Visual Studio, it's the default keyboard shortcut for Go To Definition. Very useful keyboard shortcut. I've used it countless times. I observe other co-workers NOT using it (and simply right clicking and using the menu) and have laughed at the thought. But now I know why they were doing it.
It's right next to the F11 key... what's that? Starting the project, and potentially deploying something you do NOT want to deploy.
Consider this scenario...
You're tired (like I am today)... you press F12 to check a method definition, but you fat finger it. All of a sudden, VS is building.
Building..
You immediately hit Ctrl + Alt+ Break, but guess what? You're viewing the server from RDP, so that just minimizes RDP!
Deploying...
Without any idea of what environment it's targeting (you just came here to check a few methods to analyze a problem!) you freak out. At this point let's say you forgot the menu option to stop a build. There is nothing you can do....
Deployment failed
Thank GOODNESS! An error that the solution already existed. No changes were made. It was targeting DEV in my case so I was okay anyway. But seriously, not going to use F12 anymore. Way too dangerous. Why would they put an innocent "view method definition" command in a key that is right next to a "Build, deploy, and potentially fuck up EVERYTHING" command key? Ey yey yey.
In Visual Studio, it's the default keyboard shortcut for Go To Definition. Very useful keyboard shortcut. I've used it countless times. I observe other co-workers NOT using it (and simply right clicking and using the menu) and have laughed at the thought. But now I know why they were doing it.
It's right next to the F11 key... what's that? Starting the project, and potentially deploying something you do NOT want to deploy.
Consider this scenario...
You're tired (like I am today)... you press F12 to check a method definition, but you fat finger it. All of a sudden, VS is building.
Building..
You immediately hit Ctrl + Alt+ Break, but guess what? You're viewing the server from RDP, so that just minimizes RDP!
Deploying...
Without any idea of what environment it's targeting (you just came here to check a few methods to analyze a problem!) you freak out. At this point let's say you forgot the menu option to stop a build. There is nothing you can do....
Deployment failed
Thank GOODNESS! An error that the solution already existed. No changes were made. It was targeting DEV in my case so I was okay anyway. But seriously, not going to use F12 anymore. Way too dangerous. Why would they put an innocent "view method definition" command in a key that is right next to a "Build, deploy, and potentially fuck up EVERYTHING" command key? Ey yey yey.
Friday, April 3, 2015
#regions inside methods.
You know what I really, really hate.
#region declarations INSIDE of methods.
#regions OUTSIDE of methods is completely fine, makes code better organized (when used correctly), and overall helps us find things better.
But INSIDE METHODS?
I just saw one inside of a method, the region was called:
load the data
And it had about 5 lines of code. FIVE!
How does this help organization? Now I have to go click the + sign in VS just to see your 5 lines of code.
Now imagine this EVERYWHERE in a project, and you have an idea of what I am going through right now.
Hey, if you like regions inside methods, you know what you should REALLY be using?
SUBMETHODS.
Submethod the shit out of every embedded #region you have. Too many submethods? Make a new class. Reuse code. Keep it consistent. Keep it meaningful. Make it look like you actually give a fuck about what your code looks like. Don't worry, you have enough time. Hell, you'll probably save some.
#region declarations INSIDE of methods.
#regions OUTSIDE of methods is completely fine, makes code better organized (when used correctly), and overall helps us find things better.
But INSIDE METHODS?
I just saw one inside of a method, the region was called:
load the data
And it had about 5 lines of code. FIVE!
How does this help organization? Now I have to go click the + sign in VS just to see your 5 lines of code.
Now imagine this EVERYWHERE in a project, and you have an idea of what I am going through right now.
Hey, if you like regions inside methods, you know what you should REALLY be using?
SUBMETHODS.
Submethod the shit out of every embedded #region you have. Too many submethods? Make a new class. Reuse code. Keep it consistent. Keep it meaningful. Make it look like you actually give a fuck about what your code looks like. Don't worry, you have enough time. Hell, you'll probably save some.
Saturday, May 17, 2014
C# In Depth this weekend
My copy of Jon Skeet's book arrived on Friday, and I must say, I'm only 15 pages in and am finding tons of stuff I wish I was already using! Lambda's are awesome...
Thursday, May 15, 2014
What causes variables to change? A Software Newbie Story.
As a newbie software developer I was always tripped up about the concept of assigning a value or reference to a variable. I'd notice that sometimes the variable value changes automatically if some events happens, while other times, it never does. I knew the basic concept of value vs reference that I had learned in school, but had never really applied it (and knew that I had applied it!). Then, I ran into a few problems where my variable would change without reason (seemingly), and questioned the basic concepts of variables.
Little did I know that a variable that is a reference type (and assigned an actual reference to an object) will change if other related objects change. For example, the value of a DataGridViewCell variable will change if you re-fill the dataset. However, a row index assigned to a value type (i.e. integer) will never change without you directly re-assigning it. It's an interesting concept that honestly still trips me up sometimes.
Anyway - A random story for ya.
Little did I know that a variable that is a reference type (and assigned an actual reference to an object) will change if other related objects change. For example, the value of a DataGridViewCell variable will change if you re-fill the dataset. However, a row index assigned to a value type (i.e. integer) will never change without you directly re-assigning it. It's an interesting concept that honestly still trips me up sometimes.
Anyway - A random story for ya.
Wednesday, May 14, 2014
Calling a CLICK METHOD from another method!
You know what I hate? When a developer decides to call a btn_Click method from another method. I mean, seriously, what the fuck? I work with a lot of older applications and many of them weren't written well. I think putting a btn_click method in the Form_Load spells "code being on the verge of unmaintainability" because all kinds of crazy shit happens.
For example, I'd show FormA, which would run the Load method of FormA. That Load method would run a click event that starts FormB. So the next thing I see in the GUI is FormB, not FormA! I was like, "WTF! I did NOT show that form! Madness!!!"
Click events planted in other methods (or EVENTS) are like planting bombs. They will go off with a bang if you do not disarm them.
For example, I'd show FormA, which would run the Load method of FormA. That Load method would run a click event that starts FormB. So the next thing I see in the GUI is FormB, not FormA! I was like, "WTF! I did NOT show that form! Madness!!!"
Click events planted in other methods (or EVENTS) are like planting bombs. They will go off with a bang if you do not disarm them.
Wednesday, April 30, 2014
Tip of the Day
When working with column names in your DataGridView, always refer to them as Column.Name, rather than "ColumnName".
Example:
Since you're just referencing the actual columns, you will only get a compilation error. That is *much* more visible than the alternative and will make your code easier to work with.
P.S.: My recent posts may have had nothing to do with C#. I will probably be moving over to a more IT/General Development style. I will also be posting more tidbits such as this. :)
Example:
Select Case colCheckBox
Case "colApprovedByExecutive"
If desiredCheckboxStatus = True Then
cellDate.Value = DateTime.Now().ToString()
cellUsername.Value = GetLoggedInUser()
Else
cellDate.Value = New DateTime(1753, 1, 1)
cellUsername.Value = String.Empty
End If
End Select
Simply, don't do this. When you remove columns, rename them, or whatever, you'd have to search through the solution for every last one. Instead, use:
Case colApprovedByExecutive.Name ...
Since you're just referencing the actual columns, you will only get a compilation error. That is *much* more visible than the alternative and will make your code easier to work with.
P.S.: My recent posts may have had nothing to do with C#. I will probably be moving over to a more IT/General Development style. I will also be posting more tidbits such as this. :)
Monday, April 21, 2014
Team Foundation Server - Unshelving
Why does TFS ask us if we want to save changes to our local project when we unshelve a shelveset for that same project? The fact that we are unshelving changes obviously means we want to overwrite any local changes with the shelveset files. So why would they ask us that question? If you click No to saving changes, you're probably fine. But if you click yes - BOOM! Errors abound. You have to undo the pending changes you just unshelved, then unshelve them again. What a waste of time. Better hope you preserved the shelveset or took a backup, because if you didn't you're fucked.
Wednesday, April 9, 2014
Windows 7 update
Microsoft, if you can't restore all of our open programs and documents when you decide to update and restart without asking us, then don't fucking update.
Sunday, April 6, 2014
Oracle SQL Developer
As far as usability and presentment is concerned this program is seriously a joke. If you have been using SQL Server for years, and you try to use this DBMS, it's incredibly frustrating. Every common function you want to perform won't have a button, or even a menu option. It's a keyboard shortcut. For example, to start a new query tab in Oracle SD, you have to type Ctrl + Shift + N. There is no button, menu item, and to boot, it was not easy to find searching on the net. Are you fucking kidding me? Did you not think that would be a common feature that we would like to just click? In SQL Server, you just click New Query.
Similarly, code comments has no button either. It's a keyboard combination: Ctrl + /. Whoever made this software, I have a message for you: Welcome to the 2000s. We have GUIs now. Did you miss that?
Similarly, code comments has no button either. It's a keyboard combination: Ctrl + /. Whoever made this software, I have a message for you: Welcome to the 2000s. We have GUIs now. Did you miss that?
Thursday, December 19, 2013
TFS
It's impossible to perform any action in Team Foundation Server (integrated with VS 2010) without encountering an error. Seriously. Impossible.
Saturday, November 2, 2013
DevExpress GridView - Spell Checker option for uppercase words
Didn't find this anywhere on the net, and it was bothering me for a while. So here it is, folks.
DevExpress's XtraSpellChecker does not underline uppercase words that are misspelled (by default). In order to make it recognize misspelled uppercase words, use the SetSpellCheckerOptions method of the Spell Checker control. To do this in the GridView you would use:
Dim spellingOptions As OptionsSpelling = New OptionsSpelling()
spellingOptions.IgnoreUpperCaseWords = DefaultBoolean.False
spellingOptions.IgnoreMixedCaseWords = DefaultBoolean.False
SpellCheckerCtrl.SetSpellCheckerOptions(gvwSA.ActiveEditor, spellingOptions)
http://www.devexpress.com/Support/Center/Question/Details/Q317371
DevExpress's XtraSpellChecker does not underline uppercase words that are misspelled (by default). In order to make it recognize misspelled uppercase words, use the SetSpellCheckerOptions method of the Spell Checker control. To do this in the GridView you would use:
Dim spellingOptions As OptionsSpelling = New OptionsSpelling()
spellingOptions.IgnoreUpperCaseWords = DefaultBoolean.False
spellingOptions.IgnoreMixedCaseWords = DefaultBoolean.False
SpellCheckerCtrl.SetSpellCheckerOptions(gvwSA.ActiveEditor, spellingOptions)
http://www.devexpress.com/Support/Center/Question/Details/Q317371
Tuesday, October 29, 2013
The bad week
Another day with that great "wow, I got nothing done be because I'm working on difficult, grueling projects" feeling. I am diseased.
Wednesday, September 25, 2013
"Which one do I want to save?"
I find it annoying to have to read this everywhere I go in Windows 7. "What should I do?" or similar options in many Windows 7 applications that basically convey, "I don't know what I want. Microsoft, tell me what to do." Now hold on, I do understand there may be people who are not used to computers or are older, and they are not used to it. But still - when you're offered two options that clearly differentiate themselves, you should be able to know what you want to do.
I.E. - In Burn a Disc. You have the option to write anytime, or only write once. Gee, that's a thinker. If I want to be able to re-write over the disc, I think I'll pick option one.
Or Excel. It asks, "Which of these documents, that you didn't save last time, do you want to save?" Hmm let me think. I guess I'd look at a few of them, and determine which one actually had my latest work. Or maybe I want to use an older version of my document. That might be helpful! Microsoft, tell me what to do!
When clicking on one of these links, you usually get directed to a help file. Interestingly, the first step in that help file is usually, "Use whatever method fits your needs". *rolls eyes*
I.E. - In Burn a Disc. You have the option to write anytime, or only write once. Gee, that's a thinker. If I want to be able to re-write over the disc, I think I'll pick option one.
Or Excel. It asks, "Which of these documents, that you didn't save last time, do you want to save?" Hmm let me think. I guess I'd look at a few of them, and determine which one actually had my latest work. Or maybe I want to use an older version of my document. That might be helpful! Microsoft, tell me what to do!
When clicking on one of these links, you usually get directed to a help file. Interestingly, the first step in that help file is usually, "Use whatever method fits your needs". *rolls eyes*
Friday, September 13, 2013
An interesting workaround for non CLS-compliant variables
... I didn't say it was the BEST workaround...
But I ran into a situation recently in one of my company's VB.net projects where I had to pass a worksheet (Excel.Interop) into a new form (constructor). Apparently when you have a non CLS compliant object type passed into a constructor, you get the warning, "type of parameter is not CLS-complaint".
If you find VS warnings as annoying as I do, you want to get rid of that. You can do so by (caution, its overly simplistic): converting the worksheet to the generic Object class before passing it in. Then just re-convert it back to worksheet in the constructor.
I.E.
This does create more code but you get that "0 warnings feeling" that you're taking good care of your project.
But I ran into a situation recently in one of my company's VB.net projects where I had to pass a worksheet (Excel.Interop) into a new form (constructor). Apparently when you have a non CLS compliant object type passed into a constructor, you get the warning, "type of parameter is not CLS-complaint".
If you find VS warnings as annoying as I do, you want to get rid of that. You can do so by (caution, its overly simplistic): converting the worksheet to the generic Object class before passing it in. Then just re-convert it back to worksheet in the constructor.
I.E.
Dim arSheetHiding As Object = CType(arSheet, Object)
yourForm = New YourForm(arSheetHiding)
...
Public Sub New(ByVal sheet As Object)
InitializeComponent()
Dim wkst As Excel.Worksheet = CType(sheet, Excel.Worksheet)
_WorkSheet = wkst
...
End Sub
This does create more code but you get that "0 warnings feeling" that you're taking good care of your project.
Thursday, January 10, 2013
Friday, November 9, 2012
"I found a work around. Thanks."
IF YOU FIND A WORK AROUND FOR A CODING ISSUE,
POST THE WORK AROUND. DON'T JUST POST "Oh Hey Guys It's Alright I figured it out!"
Don't tell us how you figured it out. It's not like there are people out there looking for a solution to an application error for hours and hours and can't find it.
JESUS CHRIST.
/devexpress
POST THE WORK AROUND. DON'T JUST POST "Oh Hey Guys It's Alright I figured it out!"
Don't tell us how you figured it out. It's not like there are people out there looking for a solution to an application error for hours and hours and can't find it.
JESUS CHRIST.
/devexpress
Thursday, September 6, 2012
The truth
Every good application is a product of various Google searches.
(I'll be posting more stuff soon, been very busy...
Although the blog may not be just C# as the title suggests.)
(I'll be posting more stuff soon, been very busy...
Although the blog may not be just C# as the title suggests.)
Tuesday, May 8, 2012
{
I see
{
curlies
}
in my dreams... and they keep telling me there is more work to be done.
Vacation!?
{
curlies
}
in my dreams... and they keep telling me there is more work to be done.
Vacation!?
Subscribe to:
Posts (Atom)